You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// numberAction.js
import {actionCreator} from "redux-action-utils";
import types from "../constants/ActionTypes.js";
exports.addTag = actionCreator(types.ADD_TAG, "state");
合成的action
// rootAction.js
import * as post from "./postAction.js";
import * as number from "./numberAction.js";
module.exports = {
post: post,
number: number
};
前言
刚刚开始用redux的时候因为应用比较小,而且是单枪匹马,所以所有的action都写在一个action.js里面。后来随着应用的膨胀以及多人协作,这样显然是不行的。所以,应该像分割reducer那样分割action.
#1. action
合成的action
#2. 在container上应用他们
之前在container上绑定dispatch到action的时候是这样写的。
现在因为action是组合的action,所以大概要写成这个样子。
The text was updated successfully, but these errors were encountered: