Hey everyone, I'm looking for some guidance on how to destructure action type and props in an ngrx effect. I'm struggling with this and could use some help!
This is my list of actions:
export const addTab = createAction(
'[SuperUserTabs] add tab',
props<{ tab: SuperUserHeaderTab, tabType: TabType }>()
);
export const searchCompanyTab = createAction(
'[SuperUserTabs] search company tab'
);
export const searchCardholderTab = createAction(
'[SuperUserTabs] search cardholder tab'
);
Here's the effect code:
@Effect({ dispatch: false })
addTab$ = this.actions$.pipe(
ofType(
TabsActions.addTab,
TabsActions.searchCompanyTab,
TabsActions.searchCardholderTab
),
withLatestFrom(this.store.pipe(select(getTabs))),
tap(([action, tabs]) => {
// My issue lies here
const {type, props} = action;
// additional logic
})
);
Any advice or suggestions would be greatly appreciated!