escherpad / luna

a reactive redux library written using Rxjs with built-in thunk and async action support
45 stars 2 forks source link

Luna vs @ngrx/store #4

Open ksachdeva opened 8 years ago

ksachdeva commented 8 years ago

Hi,

Would appreciate if you could provide some differences between Luna and ngrx/store (https://github.com/ngrx/store). At very high level both of these projects seem to have the same goal i.e. use the RxJS to implement the redux.

Regards & thanks Kapil

AMar4enko commented 8 years ago

@ksachdeva, one and the most important for me - it doesn't depend on Angular2, so you can use it with React too. That allows you to reuse your redux stores with React, Angular2 etc. by simply reimplementing sagas (or middlewares).

geyang commented 8 years ago

ha, Thanks @AlexYankee ! I had too much spam in my gmail so missed these emails.

@ksachdeva ,

Alex is right, this one does not depend on Angular2. After I had to abandon a very large codebase I wrote in Angular1, I decided that tight tie-down to Angular's module/DI system is not something I want for a my new project. This is especially true for the model layer of a web app. It is very easy to swap out the view rendering layer of a web app, and use the same core model for a different platform, or during rewrite.

Now, @AlexYankee I also wrote a saga plugin for luna called luna-saga. It hooks up with luna, and allows you to run sagas with a bunch of operators. Because web pack doesn't understand the generator syntax yet (last time I checked), I think it is compiled into ES6. Let me know if you have any problem using it!

I'm using both luna and luna-saga in production with a react app. Luna was originally developed for Angular2, and was my attempt at building a reactive redux store for Angular2 before Rob made his store available. After using Angular 2 for a month, I switched to react, and was super happy about the decisions I made in making Luna independent from Angular2

AMar4enko commented 8 years ago

@episodeyang, yeah, thanks for luna-saga to! I was trying to wrap my head around sagas+typescript with it, unfortunately it was my first experience with redux and i was missing some of important effects helpers like takeLatest. Being unable to implement them by myself i had to switch to redux+redux-saga, but i'm defenitely looking forward to give luna another try.