this post
(一)
(二)
这是我当前的进程和伪代码:
@Effect()
getTraceData = this.actions$
.ofType(appActions.GET_PLOT_DATA)
.pipe(
switchMap((action$: appActions.GetPlotDataAction) => {
// instead of http post, return two event sources
// new EventSource('/data1') + new EventSource('/data2')
return this.http.post(
`http://${this.url}/low-res-data`,
action$.payload.getJson(),
{ responseType: 'json', observe: 'body', headers: this.headers });
}),
// not sure if I should use forkJoin or MergeMap
// to make the data = { data1, data2}
map((plotData) => {
return {
type: appActions.LOAD_PLOT_DATA_SUCCESS,
payload: plotData
}
}),
)