@abdulghani/combinereducers 中文文档教程
combineReducers function
这是一个用于 reducer 的轻量级 combineReducers 函数。
usage
import combineReducers from "@abdulghani/combinereducers";
import { reducerOne, reducerTwo } from "somewhere";
const combinedReducers = combineReducers({
page: reducerOne,
data: reducerTwo
});
const MyApp = () => {
const [state, dispatch] = useReducer(combinedReducers);
// render
}
combineReducers function
this is a lightweight combineReducers function for reducers.
usage
import combineReducers from "@abdulghani/combinereducers";
import { reducerOne, reducerTwo } from "somewhere";
const combinedReducers = combineReducers({
page: reducerOne,
data: reducerTwo
});
const MyApp = () => {
const [state, dispatch] = useReducer(combinedReducers);
// render
}
更多