npm.io
1.1.3 • Published 5 years ago

react-rxstore-observer

Licence
ISC
Version
1.1.3
Deps
6
Size
37 kB
Vulns
0
Weekly
0

React RxStore Observer

This is the official React bindings for RxStore Observer.

This project is currently in development.

Usage:

import { createStoreHooks } from 'react-rxstore-observer'
import store from './store'

const [useStore, useDispatch] = createStoreHooks(store);

const AwesomeComponent = () => {
    const name = useStore(store => store.name)
    const dispatch = useDispatch()
    return (
        <div>
            Hello { name } 
            <button onClick={() => dispatch({ type: 'DO_SOMETHING_AWESOME' })}>Do something awesome!</button>
        </div>
    )
}

Keywords