-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
sdk(react-native-sdk): error fixes #13549
Conversation
@@ -74,8 +74,11 @@ function _setAppStateListenerF({ getState }: IStore, next: Function, action: Any | |||
const result = next(action); | |||
const { appStateListener: newListener } = getState()['features/background']; | |||
|
|||
// @ts-ignore | |||
const appStateOldListener = AppState.addEventListener('change', oldListener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't remove the previous listener. We need to store the return value of AppState.addEventListener and place that in redux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created an action(eventSubcription) that stores the previous appStateListener.
You can simplify things by storing only the subscription and not the listener. |
fcc51a0
to
06237ef
Compare
Can you pl rename things along the lines of _SET_APP_STATE_SUBSCRIPTION then? _ means it's a private action |
No description provided.