Will Angular Signals replace NgRx (a bit)? [closed]
Asked Answered
S

3

6

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

Scuttle answered 16/4, 2023 at 13:23 Comment(1)
I have created this new library it is based on signals and it's a very good replacement for ngrx npmjs.com/package/rsm-signal-state-management medium.com/@mohammadrezaimn/…Uropod
A
5

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.

Airglow answered 16/4, 2023 at 14:30 Comment(1)
I have created this new library it is based on signals and it's a very good replacement for ngrx npmjs.com/package/rsm-signal-state-management medium.com/@mohammadrezaimn/…Uropod
S
4

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.

Succotash answered 4/5, 2023 at 4:35 Comment(1)
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.Natation
N
3

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.

Natation answered 5/8, 2023 at 9:4 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.