我的App.js
中有一个标准的redux设置,如下所示:
render() {
const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));
return (
<Provider store={store}>
<MainNavigator />
</Provider>
);
}
现在我也在此文件中添加了推送通知侦听器
componentWillMount(){
OneSignal.init('xx');
OneSignal.addEventListener('opened', this.onOpened);
}
onOpened(openResult){
//receiving data
//thinking to call an action to store the notification into redux
}
想知道在App.js
中调用一个动作将收到的通知存储到Redux中有意义吗?