4

I read a lot about Signals which will be released with Angular 16 and did already some coding with it. Pretty awesome!

I heard (and believe) it will probably replace almost all RxJs Code expect async related stuff like fetching an API.

My question: Isn’t it also a good way to handle the state management without third party tools like NgRx? What are your thoughts?

I worked myself in both mentioned technologies

Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134

4 Answers4

4

They are not the same thing:

  • NgRx is a state management lib
  • Signals are for fine-grained reactivity

NgRx will use signals though. There is a current RFC on that topic.

Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
1

The following is an excerpt from the official doc:

Signals can contain any value, from simple primitives to complex data structures.

If Signals can contain complex data structures, which also can be reactively accessed easily anywhere in the application in an immutable or mutable way, then Signals can be used as a fully fledged state management solution.

Signals has the full potential to replace NgRx in majority of the future Angular projects in my opinion.

siva636
  • 16,109
  • 23
  • 97
  • 135
  • Hard disagree. The concepts of effects, reducers and selectors are very valuable in large complex applications. Signals will only take you that far. A combination of both is best imho. – Spock Aug 05 '23 at 09:06
0

I think it's more likely to replace RxJs (not NgRx), but I haven't really figure out what store solution coming with Signals.

Ryan Wu
  • 5,963
  • 2
  • 36
  • 47
  • NGRX/store has a selectSignal method that you can use to expose your selectors as signals. Truly amazing!!! – Spock Aug 05 '23 at 09:06
-1

Signals are never going to replace Ngrx, it's a supplement.

For very simple projects you can do without Ngrx and just go with Signals. But if you are doing anything larger than a small project, you should use proper state management.

Ngrx can expose the selectors as Signals so you get the best of both worlds. It is truly amazing. We have a production application now, done with Angular 16.1, it's a large Standalone app using Ngrx/Store and Signals. It's truly game changing experience and it's amazing what Signals and inject() enable.

Spock
  • 2,482
  • 29
  • 27