0.0.5 • Published 11 months ago

@cronocode/recoil-utils v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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.

0.0.5

11 months ago

0.0.4

1 year ago

0.0.3

1 year ago