Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored Jul 23, 2024
2 parents 738f51e + 27117bf commit ddd9f42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vanilla/atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ export function atom<Value, Args extends unknown[], Result>(
) {
const key = `atom${++keyCount}`
const config = {
toString: () => key,
toString() {
return import.meta.env?.MODE !== 'production' && this.debugLabel
? key + ':' + this.debugLabel
: key
},
} as WritableAtom<Value, Args, Result> & { init?: Value }
if (typeof read === 'function') {
config.read = read as Read<Value, SetAtom<Args, Result>>
Expand Down

0 comments on commit ddd9f42

Please sign in to comment.