This repository has been archived by the owner on Jan 23, 2019. It is now read-only.
Releases: kettanaito/redux-dynamics
Releases · kettanaito/redux-dynamics
Release 1.0
Unstable release of the refactored redux-dynamics
.
Change log
- Changed strong-types solution to TypeScript
- Introduced new
Reducer
class to create reducers - Introduced more declarative way of subscribing to actions:
const commentReducer = new Reducer({ likes: 0 });
commentReducer.subscribe('ADD_LIKE', (state, action, context) => {
const nextState = state.get('likes') + action.get('amount');
return nextState;
});
export default commentReducer;
- Convert
Reducer
instances to plain pure functions with.toFunction()
:
import { createReducer } from 'redux';
import commentReducer from './commentReducer';
export default createReducer({
comment: commentReducer.toFunction()
});