Reputation: 1536
The Aurelia is awesome, but it don't provide the solution for manage state. I researching a bit and found the two concept of it.
Redux: https://www.npmjs.com/package/redux-aurelia
It allow us use core concept of redux without extra sugar. In the minimal usable version may looks like that: https://gist.github.com/wegorich/5d1fabc550fb3f01e0a57d3d4308294a It also more common for most of React apps.
Mobx: https://mobxjs.github.io/mobx/
It also looks good, and the core concept and syntax is more close to the Aurelia one. But I don't find anyone who use it with Aurelia :(
Question: So the question is what the better way to manage state in the Aurelia application?
Upvotes: 5
Views: 1043
Reputation: 2603
there is an example blog post of using Redux with Aurelia found at sitepoint. https://www.sitepoint.com/managing-state-aurelia-with-redux/
Also there is an aurelia-redux plugin out there which is providing even more support: https://www.npmjs.com/package/aurelia-redux-plugin
Upvotes: 1
Reputation: 137
Maybe you should consider this article : http://ilikekillnerds.com/2016/02/shared-state-in-aurelia/
It's appear that Aurelia ( and i m not aurelia dev ) manage singleton and reactive state easily. So, i suggest that : define Store and Reducers immediately without using Redux or MobX.
Maybe ImmutableJS can be very usefull here to define your store ( basically an object ).
And, do not forget, reducers are just pure functions. So, while you know how to write pure functions and you know how to apply to a store , you are fine.
Upvotes: 1