@cronocode/recoil-utils
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i @cronocode/recoil-utils

Weekly Downloads

104

Version

0.0.5

License

MIT

Unpacked Size

3.85 kB

Total Files

5

Last publish

Collaborators

  • mprocopenco