Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice using Aurelia with FLUX

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?

like image 341
Egor Malkevich Avatar asked Oct 29 '22 20:10

Egor Malkevich


1 Answers

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.

like image 90
sami ghazouane Avatar answered Nov 09 '22 06:11

sami ghazouane