dexie / Dexie.js

A Minimalistic Wrapper for IndexedDB
https://dexie.org
Apache License 2.0
11.07k stars 631 forks source link

Dexie Vs @ngrx db #510

Open varghesep opened 7 years ago

varghesep commented 7 years ago

I'm currently using @ngrx db in my angular app. I want to use the sync with the server feature and came across Dexie, and see many other benefits also with Dexie.

Is there anything that @ngrx db provides that Dexie does not provide?

nponiros commented 7 years ago

Well ngrx db is fully integrated in angular and uses Observables. Dexie has no angular integration, does not depend on angular and does not use Observables.

Basically the main advantage that I see with ngrx db is the usage of Observables. Whether this is a real advantage for your app depends on your architecture. If you use @angular-redux/store then you probably don't need the observables of ngrx db.

Edit: I should say that I'm not familiar with ngrx db. I just checked out the code

Here is an example of angular with dexie: https://github.com/dfahlander/Dexie.js/tree/master/samples/angular2 And here an example of angular+dexie+@angular-redux/store: https://github.com/jsperts/workshop_unterlagen/tree/master/angular/examples/Redux

varghesep commented 7 years ago

I see a Dexie.Observable add-on. Probably the observable in Dexie and @ngrx db does the same?

I agree that @ngrx db is a angular module and it integrates nicely within an Angular app. Converting Dexie to an angular module won't be that difficult.

nponiros commented 7 years ago

As you see in the two examples I linked, it is rather easy to use Dexie in angular. Just wrap it in a service and use it.

Dexie.Observable is something completely different and not really comperable to the observables of rxjs used by ngrx db. It is used for cross-tab synchronization and is needed by dexie-syncable (server sync). (Observables in angular-redux/store are the same as in ngrx db)