Skip to content
React store built on top of the new context API
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Rewrite for v4 May 20, 2018
dist bump Jun 14, 2019
examples Merge pull request #127 from didierfranc/dependabot/npm_and_yarn/exam… Dec 28, 2019
src Added getState Jun 13, 2019
.babelrc Rewrite for v4 May 20, 2018
.eslintrc Promisify actions May 29, 2018
.flowconfig Rewrite for v4 May 20, 2018
.gitignore Rewrite for v4 May 20, 2018
.prettierrc
.watchmanconfig Watchman configuration Jul 29, 2018
LICENCE Rewrite for v4 May 20, 2018
README.md fix: readme code typo Oct 18, 2018
index.js Add redux-devtools during development May 22, 2018
package.json bump Jun 14, 2019
rollup.config.js Add redux-devtools during development May 22, 2018
yarn.lock Bump handlebars from 4.1.2 to 4.5.3 Dec 28, 2019

README.md

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

You can’t perform that action at this time.