Skip to content

Commit

Permalink
fix: add undefined initial value to primitive Atom definition
Browse files Browse the repository at this point in the history
  • Loading branch information
rtritto committed Jul 20, 2024
1 parent debff8b commit 6f27425
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vanilla/atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export function atom<Value, Args extends unknown[], Result>(

// primitive atom
export function atom<Value>(
initialValue: Value,
): PrimitiveAtom<Value> & WithInitialValue<Value>
initialValue?: Value,
): PrimitiveAtom<Value | undefined> & WithInitialValue<Value | undefined>

export function atom<Value, Args extends unknown[], Result>(
read: Value | Read<Value, SetAtom<Args, Result>>,
Expand Down

0 comments on commit 6f27425

Please sign in to comment.