-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix Redux support, update Redux example
- Loading branch information
Pavel Aksonov
committed
Aug 10, 2018
1 parent
7d4d288
commit 55cffdd
Showing
11 changed files
with
134 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
const INITIAL_STATE = {data: null}; | ||
import { ActionConst } from 'react-native-router-flux'; | ||
const INITIAL_STATE = { data: null, currentScene: 'home' }; | ||
|
||
export default (state = INITIAL_STATE, {type, payload}) => { | ||
switch (type) { | ||
case 'data': | ||
return {...state, data: payload}; | ||
export default (state = INITIAL_STATE, { type, payload, routeName }) => { | ||
switch (type) { | ||
case ActionConst.FOCUS: | ||
console.log('FOCUS event fired with scene parameter: ', routeName); | ||
return { ...state, currentScene: routeName }; | ||
case 'data': | ||
return { ...state, data: payload }; | ||
|
||
default: | ||
return state | ||
} | ||
} | ||
default: | ||
return state; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4861,7 +4861,7 @@ [email protected]: | |
react-native-dismiss-keyboard "1.0.0" | ||
|
||
"react-native-router-flux@file:..": | ||
version "4.0.0-beta.43" | ||
version "4.0.0" | ||
dependencies: | ||
lodash.isequal "^4.5.0" | ||
opencollective "^1.0.3" | ||
|
@@ -4961,6 +4961,12 @@ [email protected]: | |
dependencies: | ||
react-native-drawer-layout-polyfill "^1.3.2" | ||
|
||
react-navigation-redux-helpers@^2.0.5: | ||
version "2.0.5" | ||
resolved "https://registry.yarnpkg.com/react-navigation-redux-helpers/-/react-navigation-redux-helpers-2.0.5.tgz#2c2412d5b7184bbcee850b5d2c350cca34ad6cf6" | ||
dependencies: | ||
invariant "^2.2.2" | ||
|
||
[email protected]: | ||
version "0.6.0" | ||
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.6.0.tgz#2f526194f4360e56c2702e736887449acc2080dc" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.