Category : state-management

I looking for a solution for UNDO implementation in my project. I’m using ngrx in Angular. One of the approach I’m trying is, I’m creating store for undo Working Example: https://stackblitz.com/edit/github-s2fk9e But my problem became more interesting when some of my undoable operation includes multiple action dispatches. I’m looking for other possible way to implement ..

Read more

I am learning NGXS, I have a lazy selector as below @Selector() static getStudent(state: StudentModel) { return (std_id: string) => { return state.students[std_id]; } } in component, I tried to get a snapshot of that selector let _student = this.store.selectSnapshot(StudentState.getStudent); console.log(‘_student : ‘, JSON.stringify(_student )); But the result is undefined Any Suggestion is appreciated Source: ..

Read more

I am learning NGXS, and have a model for parent/child components as below (class and student) model.ts export interface Student { student_id: string; active: boolean; … } action.ts export class GetStudents { static readonly type = ‘[Student] Get Student’; constructor(public class_id: string) { } } export class ActivateStudent { static readonly type = ‘[Student] activate’; ..

Read more

I have 2 API calls for data fetching and 2 dispatch events for the data store in ngrx store. The problem is When I call the first FETCH_FINANCIAL_INSTITUTION dispatcher and 2nd FETCH_USER_GROUPS dispatcher, institutions are removed. See the below screenshots. See below my implementations, For Institutes, this.store.dispatch({ type: Action.FETCH_FINANCIAL_INSTITUTION, payload: <IFinancialInstitution[]> institutions, }); For user ..

Read more