I have an angular 5 app with an ngrx store for my widgets which are stored with an backend (socket.io). This is how my widget looks.
widgets: {
1: {
id: 1,
type: 'datatable',
startDate: startDate,
endDate: endDate,
dataStream: ''
},
2: {
id: 2,
type: 'chart',
startDate: startDate,
endDate: endDate,
dataStream: ''
}
}
Every Widget has a startdate and an enddate. I have already some effects and actions for loading, adding and updating the Widgets in my ngrx store and component. The components are created based on this Widgets and can be a chart or datatable. And each of this widget should get the datastream (columns, rows, datapoins) from the backend.
My question is how can I implement this with ngrx? Should I load the complete data object from the backend to the widget item or what is the best approach for getting the data based on the Widget from my ngrx store.