npm.io
0.0.2 • Published 4 years ago

@g123jp/recoil-observer

Licence
MIT
Version
0.0.2
Deps
0
Size
9 kB
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

recoil-observer

A simple recoil dev tool to observe the state changes.

  • log the state once changed.
  • post message to other dev tool like a chrome-extension.
  • optional to do nothing in production environment.

1. install

yarn add recoil-observer

with

  • recoil (>=0.6)
yarn add recoil

2. usage

import { RecoilObserver } from 'recoil-observer';
return (
  <RecoilRoot>
    <RecoilObserver />
    ...
  </RecoilRoot>
);
3. API
props description default value type
checkInitState whether check the default state or not true boolean
log console.log the state KV true boolean
useDevTools post the message to other devTools false boolean