Best Practices for Using Aurelia with FLUX

Aurelia is awesome, but it does not provide a state management solution. I understand a bit and found two concepts for this.

Redux: https://www.npmjs.com/package/redux-aurelia

This allows us to use the basic concept of reduction without additional sugar. In a minimal useful version it might look like this: https://gist.github.com/wegorich/5d1fabc550fb3f01e0a57d3d4308294a This is also more common for most React applications.


Mobx : https://mobxjs.imtqy.com/mobx/

It also looks good, and the basic concept and syntax are closer to Aurelia. But I do not find those who use it with Aurea :(

Question: So the question is, what is the best way to manage state in an Aurelia application?

+5
source share
2 answers

Perhaps you should consider this article: http://ilikekillnerds.com/2016/02/shared-state-in-aurelia/

It seems that Aurelia (and I m not aurelia dev) easily manage singleton and reactive state. Therefore, I suggest: immediately identify Store and Reducers without using Redux or MobX.

Perhaps ImmutableJS can be very useful here to define your store (mostly an object).

And don't forget, gearboxes are just pure functions. So, although you know how to write pure functions, and you know how to contact the store, you are fine.

+1
source

There is an example blog using Redux with Aurelia found on the site. https://www.sitepoint.com/managing-state-aurelia-with-redux/

There is also aurelia-redux plugin that provides even more support: https://www.npmjs.com/package/aurelia-redux-plugin

+1
source

All Articles