Thomas Kolar, Engineer @SilverTours GmbH
Persist state to a local storage and then boot up from it, out of the box.
import {persistStore, autoRehydrate} from 'redux-persist'
const store = createStore(reducer, undefined, autoRehydrate())
persistStore(store)
Comes with support for several storage engines like...
AsyncStorage for react-native ...
or localForage for web apps.
Serialize user actions and attach them, together with a state snapshot, to automated bug reports.
Product developers can replay them to reproduce the errors.
// ES6
import { storeEnhancer } from 'redux-bug-reporter'
// ES5
var storeEnhancer = require('redux-bug-reporter').storeEnhancer
function configureStore(initialState) {
const store = createStore(reducer, initialState, compose(
process.env.NODE_ENV !== 'production' ? storeEnhancer : f => f,
applyMiddleware(...middleware)
));
return store;
}
Pre-fill your state on the server.
Send the state over the network and boot from it.
Server Rendering in ReduxPass action objects over the network to implement collaborative environments without dramatic changes to how the code is written.
Hell! You can even pass the complete state over network!
Travel between the state history in development
Re-evaluate the current state from the action history when the code changes, a la TDD.
redux-devtoolsMaintain an undo history or implement optimistic mutations without dramatic changes to how the code is written.
Immutable data cannot be changed once created
var Immutable = require('immutable');
var map1 = Immutable.Map({a:1, b:2, c:3});
var map2 = map1.set('b', 50);
map1.get('b'); // 2
map2.get('b'); // 50
No more defensive copying!
let nextState = [...state];
// Bye, bye mutable states in reducers!
Advanced Data Structures including: List, Stack, Map, OrderedMap, Set, OrderedSet and Record.
Object comparison
var map1 = Immutable.Map({a:1, b:2, c:3});
var map2 = map1.set('b', 2);
assert(map1.equals(map2) === true);
var map3 = map1.set('b', 50);
assert(map1.equals(map3) === false);