Answer the question
In order to leave comments, you need to log in
How to properly architecture an NGRX action with two logical steps?
Comrades help with a question on NGRX.
There is such a structure
{
currentItem: 89,
items: [77, 89, 99]
}
{
currentItem: 77,
items: [77, 89, 99]
}
Answer the question
In order to leave comments, you need to log in
Add logic to the Action class itself.
Usually, each action has its own class.
interface Navigate {
currentItem: number;
items: number[]
}
export class NavigateToFirst implements Action {
readonly type = NavigateActions.CHANGE_Navigate;
public payload: Navigate;
constructor(navigate: Navigate) {
// change
this.payload = navigate;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question