Когда я пытаюсь запустить код ниже:
functionMap = {
[ActionTypeEnum.TYPE_FIRST.toLowerCase()]:[getInitialDataStatus({statusType: 'disabled'}),fetchImportantDataFirst()],
[ActionTypeEnum.TYPE_SECOND.toLowerCase()]:[getInitialDataStatus({}),
fetchImportantDataSecond()],
[ActionTypeEnum.TYPE_THIRD.toLowerCase()]:[getInitialDataStatus({}),
fetchImportantDataThidr()]
}
startMultpileActionDepensOnType$ = createEffect(() => this.actions$.pipe(
ofType(startMultpileActionDepensOnType),
withLatestFrom(this.store$.select(selectTypeActions)),
map(([action, select]) => {
const actionType = select.type.toLowerCase();
return this.unctionMap[actionType]
}
)
));
Я получаю сообщение об ошибке:
TS2322: Type 'Observable<TypedAction<string>[]>' is not assignable to type 'Observable<Action>'. Property 'type' is missing in TypedAction<string>[].
Но когда я изменяю на: functionMap:{}
,
Я получил ошибку:
Action must have a type property