mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
added demo code to step 5
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
import { reducer } from './reducers';
|
||||
import { createStore } from 'redux';
|
||||
import { actions } from './actions';
|
||||
import { composeWithDevTools } from 'redux-devtools-extension';
|
||||
|
||||
const store = createStore(reducer);
|
||||
const store = createStore(reducer, {}, composeWithDevTools());
|
||||
|
||||
store.dispatch(actions.addTodo('hello'));
|
||||
|
||||
let action = actions.addTodo('world');
|
||||
store.dispatch(action);
|
||||
|
||||
store.dispatch(actions.remove(action.id));
|
||||
|
||||
console.log(store.getState());
|
||||
|
||||
Reference in New Issue
Block a user