react-native-navigation的迁移库

reducer.js 389B

123456789101112131415161718
  1. import * as types from './actionTypes';
  2. import Immutable from 'seamless-immutable';
  3. const initialState = Immutable({
  4. root: undefined // 'login' / 'after-login'
  5. });
  6. export default function app(state = initialState, action = {}) {
  7. switch (action.type) {
  8. case types.ROOT_CHANGED:
  9. return state.merge({
  10. root: action.root
  11. });
  12. default:
  13. return state;
  14. }
  15. }