@alcadica/state-manager-react
v1.0.4
Published
A simple modular state manager for your applications
Downloads
5
Readme
state-manager-react
Install
npm i --save @alcadica/{state-manager,state-manager-react}
Usage
import React, { Fragment } from 'react';
import store, { actions } from './my-previously-defined-store';
import withManager from '@alcadica/state-manager-react';
const Foo = (props) => (
<Fragment>
<div>{ props.counter }</div>
<button onClick={ store.dispatch(actions.increment(1)) }></button>
</Fragment>
);
export default withManager(store)(Foo);