From d15c23bce15d4173212f381cc52b0b6baa90512a Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 25 Jan 2025 11:07:30 -0800 Subject: [PATCH] fix: exclude `undefined` from non-nullable atom --- src/charm/src/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/charm/src/index.d.ts b/src/charm/src/index.d.ts index e31bf06..676662f 100644 --- a/src/charm/src/index.d.ts +++ b/src/charm/src/index.d.ts @@ -16,7 +16,10 @@ declare namespace Charm { * @param state The next state or a function that produces the next state. * @returns The current state, if no arguments are provided. */ - type Atom = (state?: State | ((prev: State) => State)) => State; + interface Atom { + (): State; + (nextState: State | ((prevState: State) => State)): void; + } /** * A function that depends on one or more atoms and produces a value. Can be