Injectable Actions
@Injectable({ providedIn: 'root' })
@InjectStore('users')
export class TodosStateActions extends HasSignalStore<TodoModel[]> {
constructor(private userService: DataService) {
super();
}
getUsers() {
this.userService.getData().subscribe(() => {
this.store.update(state => {
state.users.push(...state);
});
});
}
}
Last updated