This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let NBA = { | |
| season : { | |
| year : '2017', | |
| start: '2016-10', | |
| end : '2017-6', | |
| state: 'active' | |
| }, | |
| players: [ | |
| { | |
| name : 'duncan', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //https://egghead.io/lessons/javascript-redux-the-single-immutable-state-tree | |
| //redux | |
| const createStore = (reducer, initialState) => { | |
| let state = initialState; | |
| let listeners = []; | |
| const getState = () => state; | |
| const dispatch = (action) => { | |
| state = reducer(state, action); |
NewerOlder