0.0.2 • Published 3 years ago

@g123jp/recoil-observer v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

propsdescriptiondefault valuetype
checkInitStatewhether check the default state or nottrueboolean
logconsole.log the state KVtrueboolean
useDevToolspost the message to other devToolsfalseboolean