Skip to content

Instantly share code, notes, and snippets.

@NoriSte
Last active October 9, 2020 06:41
Show Gist options
  • Save NoriSte/00a1aed85faccb8c635cc0d42869ee80 to your computer and use it in GitHub Desktop.
Save NoriSte/00a1aed85faccb8c635cc0d42869ee80 to your computer and use it in GitHub Desktop.
Re-implementing Recoil APIs / article gists
// @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