I really like the Redux concept. It allows developers to avoid state manipulation to be spread across the application, leading to difficult to dete...
For further actions, you may consider blocking this person and/or reporting abuse
we are currently facing the same problem with ngrx. We have a quite complex angular app that grew over time and now has a ridiculous amount of boilerplate code for ngrx. my biggest fear is that new team members will have a really hard time understanding what is going on. and the biggest problem of all that boilerplate code is that you can't understand what are the vital parts, as the concept is not self-explanatory at all. akita looks like a good alternative.
Did you give Akita a try? How is that working for you?
Yes, we actually did. We switched one single page application completely and will start with the second soon.
So far it's working really well. We were able to reduce complexity and increase maintainability along the way.
Super article!!!
Akita is more awesome than I had imagined. Super easy to implement.
In a nut shell: I simply write my Angular application as usual, with my model & service (http). And Akita fits right in. Tell Akita to use my model and voila!
Let the service pass any data to the store, then the query as the data which can be returned to the component via observable. Even better to use
*ngxSubscribe=
inside a form. Saving form data is easy too. Pass it to the service which updates the store.Hey @joao , I have been working with Angular+NGRX for the last 2.5 years. I think the strongest part of ngrx is the actions. Once we done with one action stream(with side effects), yes its like a boilerplate. To me ngrx is super awsome.
But for a fresher its very difficult to understand.
I recently read about AKITA, yes what you said was absolutely correct and AKITA is super cool. I am trying to migrate my application from ngrx to AKITA.
IMHO NgRx would really benefit from a Akita-like solution that transforms a service into methods in actions+reducers. For a larger project, actions+reducers start multiplying like there's no tomorrow.
There are pet peeves of mine I didn't mention, like the need to declare the reducers in StoreModule (when Angular has builtin Dependency Injection), weird AOT issues when dealing with different libraries, such as ngrx-forms + ngrx-actions.
I would still recommend NgRx to a team that's familiar with React, though.
I think NGRX Entities and NGRX Data solves most of the boilerplate everyone hate so much.
You can use the cli to generate entities just like you do in Akita
"ng generate entity my-entity"
You gain the full redux + redux devtools
Effects are also very well handled in NGRX.
Selectors are now memoized (cache) and they can use rxjs operators of course
Data normalization is also something that comes out of the box when using NGRX.
So I agree that NGRX in the past had a lot of issues and the boilerplate was a mess but it is changing rapidly and in a good direction.
I would still open up the discussion with the team for every new project cause stuff can change over time.
I think right now Ngrx and Akita are very similar. NGRX improves a lot on reducing boilerplate. And NGRX can work with REDUX DEVTOOLS. Akita is a pretty neat library for other framework like vue but in Angular, I think NGRX is still the best choice.