Last active
October 9, 2020 06:41
-
-
Save NoriSte/00a1aed85faccb8c635cc0d42869ee80 to your computer and use it in GitHub Desktop.
Re-implementing Recoil APIs / article gists
This file contains hidden or 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
// @see https://github.com/NoriSte/recoil-apis | |
/* | |
* The internally stored Recoil values | |
*/ | |
export type CoreRecoilValue<T> = { | |
key: string; | |
subscribers: Subscriber[]; | |
} & ( | |
| { | |
type: "atom"; | |
default: T; | |
value: T; | |
} | |
| { | |
type: "selector"; | |
} | |
); | |
export type Subscriber = () => void; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment