@abdulghani/combinereducer 中文文档教程

发布于 5年前 浏览 21 项目主页 更新于 3年前

combineReducers function

这是一个用于 reducer 的轻量级 combineReducers 函数。 适用于 reduxuseReducer

installation

纱线

yarn add @abdulghani/combinereducer

npm

npm install @abdulghani/combinereducer

usage

import combineReducer from "@abdulghani/combinereducer";
import { reducerOne, reducerTwo } from "somewhere";

const combinedReducers = combineReducer({
  page: reducerOne,
  data: reducerTwo
});

const MyApp = () => {
  const [state, dispatch] = useReducer(combinedReducers);

  // render
};

combineReducers function

this is a lightweight combineReducers function for reducers. works with either redux or useReducer.

installation

yarn

yarn add @abdulghani/combinereducer

npm

npm install @abdulghani/combinereducer

usage

import combineReducer from "@abdulghani/combinereducer";
import { reducerOne, reducerTwo } from "somewhere";

const combinedReducers = combineReducer({
  page: reducerOne,
  data: reducerTwo
});

const MyApp = () => {
  const [state, dispatch] = useReducer(combinedReducers);

  // render
};
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文