我遇到了这样一个问题,即存储不发送成功操作,在所有其他情况下,一切都对我有用,但在这方面它没有
我的行动
export const getPrintingEditions = createAction(
PrintingEditionActions.GET_PRINTING_EDITIONS,
props<{paginationQuery?: PaginationQuery, filter?: PrintingEditionFilter}>()
)
export const getPrintingEditionsSuccess = createAction(
PrintingEditionActions.GET_PRINTING_EDITIONS_SUCCESS,
props<PagedResponce>(),
)
export const getPrintingEditionsFailure = createAction(
PrintingEditionActions.GET_PRINTING_EDITIONS_FAILURE,
props<{error: any}>()
)
我的效果
getPrintingEditions$ = createEffect(() => this.actions$.pipe(
ofType(printingEditionActions.getPrintingEditions),
mergeMap(action => this.printingEdition.getPrintingEditions(
action.paginationQuery,
action.filter
).pipe(
map(pagedResponce => printingEditionActions.getPrintingEditionsSuccess(pagedResponce)),
catchError(err => of(printingEditionActions.getPrintingEditionsFailure(err)))
)
)))
减速机代码
on(printingEditionActions.getPrintingEditionsSuccess, (state, action) =>
peAdapter.setAll(action.data, {
...state,
pageNumber: action.pageNumber,
pageSize: action.pageSize,
nextPage: action.nextPage,
previousPage: action.previousPage,
})
),
我使用实体状态来管理实体
当你不在页面上做任何事情时,你等待,它开始出现故障。
我认为,问题不在行动、效果和减速器上,但我不明白问题出在哪里以及如何解决
链接到 github 上的存储库。此代码区域设置在商店 https://github.com/mrshk-vv/book-store-client