Skip to content
gcht edited this page Jun 9, 2017 · 1 revision

import { createStore } from 'redux'; const store = createStore(fn); const state = store.getState();

const ADD_TODO = '添加 TODO';

function addTodo(text) { return { type: ADD_TODO, text } }

const action = addTodo('Learn Redux');

store.dispatch({ type: 'ADD_TODO', payload: 'Learn Redux' });

Clone this wiki locally