Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

viki-org/react-waterfall

 
 

Repository files navigation

react-waterfall

React store built on top of the new context API

Basics

store.js

import createStore from 'react-waterfall'

const config = {
  initialState: { count: 0 },
  actionsCreators: {
    increment: ({ count }) => ({ count: count + 1 }),
  },
}

export const { Provider, connect, actions } = createStore(config)

App.js

import { connect, Provider, actions } from './store'

let Count = ({ count }) => count
Count = connect(({ count }) => ({ count }))(Count)

const App = () => (
  <Provider>
    <Count />
    <button onClick={actions.increment}>+</button>
  </Provider>
)

Devtools

During development redux-devtools are automatically enabled. Install the extension.

Contributors

https://github.com/didierfranc/react-waterfall/graphs/contributors

Links

About

React store built on top of the new context API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%