is there any library that handles this? like the backbone.offline one?, if not, will this be difficult to implement with Ember.js?
UPDATE
this question has two libraries that can help, Breeze.js and Jaydata..
is there any library that handles this? like the backbone.offline one?, if not, will this be difficult to implement with Ember.js?
UPDATE
this question has two libraries that can help, Breeze.js and Jaydata..
ember-localstorage
adapter can be used.
it can be used like other adapters.
App.store = DS.Store.create({
revision: 11,
adapter: DS.LSAdapter.create()
});
Another good library for ember and rails is ember-data-sync.js
Extend your App.Store from DS.SyncStore. Define the adapter you want to use for client-side storage:
App.Store = DS.SyncStore.extend({
revision: 10,
adapter: DS.IndexedDB.adapter({
mappings: {
person: App.Person,
persons: App.Person,
contact: App.Contact,
contacts: App.Contact
}
})
});
There is no library for this, but you could implement it with a custom adapter. There isn't much documentation for the adapter API and the only ones available in core so far are RESTAdapter
and FixtureAdapter
.
What you basically need to do there is implement couple of hooks and plug that into your application's store.
Looking for a solution also, and came upon the ember-sync project.
This project piggy-backs on Ember-Data, is ember-cli
-ready, and has a queuing feature that smartly handles backend record CRUD. From my brief look into it, I'd say this is the lead project for Ember.js offline-capable apps.
One critique I'd submit on this project is that it ought to also be capable of adapting with epf.io, which itself is a drop-in replacement for Ember-Data and offers transactional CRUD, nested stores -- and even per-model nested store capabilities.
At the time of writing, this project is still in alpha, though it seems to be heading in the right direction.
© 2022 - 2024 — McMap. All rights reserved.
localStorage
(or something like that) and create the logic to sync once you're back on the internet. – Rhetoricalsync
method) – Immobility