I am trying to dispatch multiple redux actions in a sequence (or at once, doesn't really matter) using Promise API and it is not working:
Promise.all([
store.dispatch(action1()),
store.dispatch(action2()),
store.dispatch(action3()),
store.dispatch(action4())
]).then(() => {
res.send(renderToString(<Provider store={store}><App /></Provider>));
});
I keep getting the following error:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'map' of null
What am I doing wrong?