@abdulghani/combinereducers 中文文档教程

发布于 5年前 浏览 27 更新于 3年前

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