Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redux #4

Open
YangW0223 opened this issue Aug 11, 2021 · 0 comments
Open

redux #4

YangW0223 opened this issue Aug 11, 2021 · 0 comments

Comments

@YangW0223
Copy link
Owner

YangW0223 commented Aug 11, 2021

三大原则

  • 单一数据源
  • state 只读
  • 使用 纯函数来修改

API

  • createStore: createStore(reducer, [preloadedState], enhancer)
  • combineReducers(reducers)
  • applyMiddleware(...middlewares)
  • compose(...functions)
  • Store
    • getState()
    • dispatch(action)
    • subscribe(listener)
    • replaceReducer(nextReducer)

immer.js:也许更适合你的immutable js库

精读《Immer.js》源码

如何用React+Redux+ImmutableJS


react-redux源码解析

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant