Store: Benefit?

Created on 5 Mar 2018  路  6Comments  路  Source: ngxs/store

Hey!
Flying over the Code, but dont see the benefit over ngrx
If there is any could you please explain what the benefits are?

Most helpful comment

I'm working on a article about this but here it is in short:

  1. Switch statements suck
  2. Spreads in every state mutation are redundant, let the framework do it for you
  3. Boilerplate hell ( 4 files for a single store )
  4. String consts EVERYWHERE
  5. Effects are difficult to understand, write and maintain
  6. You should be able to listen for the result on dispatch
  7. Sometimes you need DI in your 'reducers'
  8. Its more Angular-like code style
  9. It supports promises in addition to observables

All 6 comments

I'm working on a article about this but here it is in short:

  1. Switch statements suck
  2. Spreads in every state mutation are redundant, let the framework do it for you
  3. Boilerplate hell ( 4 files for a single store )
  4. String consts EVERYWHERE
  5. Effects are difficult to understand, write and maintain
  6. You should be able to listen for the result on dispatch
  7. Sometimes you need DI in your 'reducers'
  8. Its more Angular-like code style
  9. It supports promises in addition to observables

Here's another perspective for @ToxicToast and others to consider:

I use, like, and teach NgRx, have been using with the Redux/Elm pattern since its emergence. I'm familiar with many of the underlying ideas from prior work under the banner of CQRS/ES. ... and am still very interested to see where ngxs ends up. I don't think it's necessary to see immediate benefits over or "vs" NgRx; rather, just notice that NgRx now has some constraints in its evolution. It has a decent and growing user base, so must evolve somewhat carefully and slowly, in a mostly backward-compatible way.

A new thing like ngxs which currently has (I would assume) zero production users, can experiment with new ideas, syntax, semantics, etc. Maybe what emerges will either make this library popular, or influence other libraries in a useful direction.

Maybe "benefits" was the wrong term that ive used since English isnt my native Language

But what @amcdnl wrote sounds pretty interesting and neat - i will use it very soon in another private project of mine

A new thing like ngxs which currently has (I would assume) zero production users
@amcdnl Is it safe to use it for production application?

@shivamd20 That statement was from over a year ago, when the library was essentially 5 days old.
There are many production projects running on it now. We have over 25 000 npm downloads every week. Yes it is most definitely safe! ;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xmlking picture xmlking  路  29Comments

perjansson picture perjansson  路  30Comments

amcdnl picture amcdnl  路  19Comments

armanozak picture armanozak  路  23Comments

xmlking picture xmlking  路  29Comments