0.0.5 • Published 1 year ago
@cronocode/recoil-utils v0.0.5
Recoil utils
Installation
npm install @cronocode/recoil-utilsOr if you're using yarn:
yarn add @cronocode/recoil-utilsOr if you're using bower:
bower install --save @cronocode/recoil-utilsUsage
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.