Skip to content

migodev42/eox

Repository files navigation

Commitizen friendly Easy and react state management based on hooks api.

Installation

yarn add @leoooy/eox
npm install @leoooy/eox

Documentation

You can find the Eox documentation on the website.

Examples

/* context.js */
import { createProvider } from 'eox';
const { Provider, Context } = createProvider(reducers, initState);
export { Provider, Context }

/* APP.js */
import { Provider } from 'context.js'
const App = () => {
    return (
        <Provider>
            <Child />
        </Provider>
    )
}

/* Child.js */
import { withContext } from 'eox';
import { Context } from 'context.js'
const Child = ({dispatch,state}) => {
    return <div>
        ...
    </div>
}
export default withContext(Child,Context,{
    dispatch: ctx => ctx.dispatch,
    state: ctx => ctx.state,
})

About

Simple react state management pattern with hooks and context. https://leoooy.github.io/eoxdoc/

Resources

Stars

Watchers

Forks

Packages

No packages published