0.2.2 • Published 6 years ago

flock-js v0.2.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

flock-js

Coordinate React components' states with event sourcing.

Inspired by Redux.

Usage

In your React component, replace all useReducer with useStoreReducer:

import { useContextStoreReducer, StoreContext } from 'flock-js'
const store = createStore()

// then update your code
// from
const [state, dispatch] = useReducer(reducer, initialState)
// to
const [state, dispatch] = useStoreReducer(store, reducer, (actions) => /* compute initialState from actions */)

Components will then be able to consume each other's actions.

See test files in src/react for more information.

More functions on the way.

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago