-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose only the react-like Signal type
- Loading branch information
1 parent
20c841a
commit 971d389
Showing
5 changed files
with
40 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export type Derivation<T> = (previous: T) => Exclude<T, void>; | ||
export type Accessor<T> = () => T; | ||
export type Setter<T> = (value: T) => void; | ||
export type Signal<T> = { get: Accessor<T>; set: Setter<T> }; | ||
export type Subscriber = { derived: Signal<any> | null, execute: () => void }; | ||
export type _Signal<T> = { get: Accessor<T>; set: Setter<T> }; | ||
export type Signal<T> = [Accessor<T>, Setter<T>]; | ||
export type Subscriber = { derived: _Signal<any> | null; execute: () => void }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters