mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +00:00
fix: exclude undefined from non-nullable atom
This commit is contained in:
parent
88567e17c5
commit
d15c23bce1
1 changed files with 4 additions and 1 deletions
5
src/charm/src/index.d.ts
vendored
5
src/charm/src/index.d.ts
vendored
|
|
@ -16,7 +16,10 @@ declare namespace Charm {
|
||||||
* @param state The next state or a function that produces the next state.
|
* @param state The next state or a function that produces the next state.
|
||||||
* @returns The current state, if no arguments are provided.
|
* @returns The current state, if no arguments are provided.
|
||||||
*/
|
*/
|
||||||
type Atom<State> = (state?: State | ((prev: State) => State)) => State;
|
interface Atom<State> {
|
||||||
|
(): State;
|
||||||
|
(nextState: State | ((prevState: State) => State)): void;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function that depends on one or more atoms and produces a value. Can be
|
* A function that depends on one or more atoms and produces a value. Can be
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue