forked from zoltantothcom/Design-Patterns-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (27 loc) · 781 Bytes
/
index.js
File metadata and controls
33 lines (27 loc) · 781 Bytes
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
import { createStore, applyMiddleware, compose } from 'redux';
const uuid = require('uuid/v4');
import reducer from '../reducers/index';
import patterns from '../static/patterns';
import middleware from '../middleware';
export const answers = patterns.map(pattern => ({
...pattern,
answered: false,
correct: null,
answerId: null,
uuid: uuid()
}));
export const initialProgress = {
answers: [],
remaining: answers,
current: answers[0]
};
const initialState = {
js: 'es5',
mode: 'dark',
intro: true,
patterns: answers,
progress: initialProgress
};
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(reducer, initialState, composeEnhancers(applyMiddleware(...middleware)));
export default store;