0.2.2 • Published 5 years ago

flock-js v0.2.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 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

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago