Skip to content

Commit

Permalink
fix: atom toString includes debugLabel in dev mode (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaskasky authored Jul 15, 2024
1 parent 2271706 commit 609bd5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/useAtomsDevtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { SnapshotOptions, useAtomsSnapshot } from './useAtomsSnapshot';
import { useGotoAtomsSnapshot } from './useGotoAtomsSnapshot';

const atomToPrintable = (atom: AnyAtom) =>
atom.debugLabel ? `${atom}:${atom.debugLabel}` : `${atom}`;
atom.debugLabel && !String(atom).includes(':')
? `${atom}:${atom.debugLabel}`
: `${atom}`;

const getDevtoolsState = (atomsSnapshot: AtomsSnapshot) => {
const values: Record<string, AnyAtomValue> = {};
Expand Down

0 comments on commit 609bd5a

Please sign in to comment.