react-use-rxjs
Hooks for rxjs
Install
npm install --save react-use-rxjs
Usage
const op = { return input}const init = '2' const RxComponent = { const state publish = return <p onClick= >state</p>} <RxComponent/>
Will render 2 in the beginning, then 3 after clicked.
The first param of useRxjs
can also be an Observable
, in which case state
would be values from the passed Observable and publish
would be ignored.
The third param of useRxjs
is optional and works just like the last param of official hooks like useMemo
or useEffect
.
License
MIT