0.0.2 • Published 4 years ago
@g123jp/recoil-observer v0.0.2
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-observerwith
- recoil (>=0.6)
yarn add recoil2. 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 |