I have a project in which the nodejs server delivers push events to the interactive control panel via socket.io, I use Redux. When new data is received, the action is triggered to update all the relevant components, although I am not sure that the way I do this is correct.
This is how I track new incoming data from the server:
socket.on('incidents', state => { boundActionSetIncidentsList(state); });
And this is the creator of the limited action that is called in the new data:
import { store } from '../index'; export function boundActionSetIncidentsList(incidents) { store.dispatch(actionSetIncidentsList(incidents)); }
I need a store to post an action, as you can see that I am brutally importing it from the main index.js . Here's how it is created:
export const store = createStore();
Being very new to responsiveness and shorthand, I was wondering what a decux way to send actions that do not start from a container or presentation component is. Thanks!
reactjs redux
Slartibartfast
source share