mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +00:00
feat: add overload for nullable atoms
This commit is contained in:
parent
1906eb3b24
commit
5392fcd69b
1 changed files with 3 additions and 0 deletions
3
src/index.d.ts
vendored
3
src/index.d.ts
vendored
|
|
@ -69,6 +69,9 @@ declare namespace Charm {
|
|||
*/
|
||||
function atom<State>(state: State, options?: AtomOptions<State>): Atom<State>;
|
||||
|
||||
// Overload for no arguments
|
||||
function atom<State>(state?: State, options?: AtomOptions<State>): Atom<State | undefined>;
|
||||
|
||||
/**
|
||||
* Creates a read-only atom that derives its state from one or more atoms.
|
||||
* Used to avoid unnecessary recomputations if multiple listeners depend on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue