我正在尝试此
payloadToBeSaved$ = createEffect(() => this.actions$
.ofType(SOME_ACTION)
.withLatestFrom(this.store$)
.map(([action: Action, storeState: AppState]) => {
// Do something ...
});
但是this.actions $是可观察的,我必须使用this.actions $ .pipe()....当我尝试使用pipe()时,所有行都带有错误的红色。不知道如何解决。
@Effect()
shipOrder = this.actions.pipe(
ofType<ShipOrder>(ActionTypes.ShipOrder),
map(action => action.payload),
concatMap(action =>
of(action).pipe(
withLatestFrom(store.pipe(select(getUserName)))
)
),
map([payload, username] => {
...
})
)