forked from jvalen/pixel-art-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.js
35 lines (31 loc) · 911 Bytes
/
client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react';
import ReactDOM from 'react-dom';
import {createStore} from 'redux';
import {Provider} from 'react-redux';
import reducer from './src/reducer';
import {AppContainer} from './src/components/App';
import {Map, fromJS} from 'immutable';
import undoable, {includeAction} from 'redux-undo';
let initialState = window.__INITIAL_STATE__;
/* Make immutable initial state from server side */
initialState.present = fromJS(initialState.present);
initialState.past = initialState.past.map(function(item){
return fromJS(item);
});
const store = createStore(undoable(reducer, {
filter: includeAction([
'SET_STATE',
'SET_GRID_DIMENSION',
'SET_GRID_CELL_VALUE',
'SET_DRAWING',
'SET_CELL_SIZE',
'SET_RESET_GRID'
]),
debug: false
}), initialState);
ReactDOM.render(
<Provider store={store}>
<AppContainer />
</Provider>,
document.getElementById('app')
);