@cronocode/recoil-utils
v0.0.5
Published
Recoil utils
Downloads
267
Readme
Recoil utils
Installation
npm install @cronocode/recoil-utils
Or if you're using yarn:
yarn add @cronocode/recoil-utils
Or if you're using bower:
bower install --save @cronocode/recoil-utils
Usage
import { useRecoilCachedValue } from "@cronocode/recoil-utils";
const [stateValue, loading] = useRecoilCachedValue(
recoilSelector,
defaultValue
);
When use selectorFamily but you want to reuse same cache atom
const [stateValue, loading] = useRecoilCachedValue(
recoilSelectorFamily(selectorKey),
defaultValue,
"UniqueKeyForAnySelectorKey"
);
License
Recoil is MIT licensed.