Initial commit

This commit is contained in:
Tobias Fried
2020-07-14 17:41:45 -04:00
parent 856e1ac749
commit 3a9cf5dc99
18 changed files with 329 additions and 57 deletions

21
src/state/atoms.ts Normal file
View File

@@ -0,0 +1,21 @@
import { atom } from "recoil";
import { IconFillStyle } from "../lib/Icon";
/**
* ATOM
* An atom represents a piece of state. Atoms can be read from and written to from any component.
* Components that read the value of an atom are implicitly subscribed to that atom, so any atom
* updates will result in a re-render of all components subscribed to that atom:
*/
export type IconStyleQuery = IconFillStyle | null | undefined;
export const searchQueryAtom = atom<string>({
key: "searchQueryAtom",
default: "",
});
export const styleQueryAtom = atom<IconStyleQuery>({
key: "styleQueryAtom",
default: undefined,
});