react-native-component-redux icon indicating copy to clipboard operation
react-native-component-redux copied to clipboard

With Redux, your app's state is defined by a reducer. Each navigation router effectively has a reducer, called getStateForAction.

功能集合

  • [x] 热更新 code-push
  • [x] carousel
  • [x] redux 案例
  • [x] mobx 案例
  • [x] react-navigation 案例
  • [x] Android 硬更新
  • [x] iOS 硬更新
  • [x] native 混合

项目架构

  • [x] react-native,
  • [x] react-navigation,
  • [x] redux,
  • [x] mobx,
  • [x] react-native-vector-icons
  • [x] react-native-splash-screen
  • [x] react-native-code-push ...

自动化工具

  • [x] prettier

案例效果图

screenshot screenshot screenshot screenshot

快捷地址:

immutable doc

immutable blog

react-navigation doc

React Native Express

react-navigation-redux-helpers doc

react-navigation-redux error

介绍 Redux 中间件(Middleware)

还记得 Redux 的 GIF 嘛

我们需要稍微改变一下

正如你所看到的,这里还有一个概念:Middleware

什么是 Middleware

文档中看到:

    It provides a third-party extension point between dispatching an action, and the moment it reaches the reducer

简而言之,这是一个函数,在 Action 到达 Reducer 之前,将使用 Action 调用该函数。

在这个功能中,你可以让 Action 继续前进,你可以阻止它继续前进,或者你可以改变它,并把它发送给下一个。