Angular · Senior · Question 39 of 75
What is NgRx SignalStore?
export const TodosStore = signalStore(
withState({ todos: [] as Todo[], filter: "all" }),
withComputed(({ todos }) => ({ count: computed(() => todos().length) })),
withMethods((store) => ({ setFilter: (filter: string) => patchState(store, { filter }) })),
);- ✓Correct answer: A lightweight signal-based store built from composable features, provided like a service
- 2A replacement for Angular's DI
- 3A Redux DevTools extension
Explanation
SignalStore has no actions or reducers by default: state is a set of signals, updated with patchState. It can be provided in root or per component and extended with custom features.