JSPM

recoil-enhance

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 40
  • Score
    100M100P100Q80108F
  • License MIT

recoil-enhance proive powerful hooks

Package Exports

  • recoil-enhance
  • recoil-enhance/lib/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (recoil-enhance) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Install

npm install recoil-enhance

Usage

import { useRecoilValueMemo, useRecoilValueLoadableMemo } from 'recoil-enhance';

function App() {

- const user = useRecoilValue(userSelector);
+ const user = useRecoilValueMemo(userSelector);


- const userLoadable = useRecoilLoadable(userSelector);
+ const userLoadable = useRecoilLoadableMemo(userSelector);
}

API

useRecoilValueMemo(recoilState)

like useRecoilValue, but will not loading when refresh selector.

useRecoilValueLoadableMemo

like useRecoilValueLoadable, but loadable.content always hold latest value.