Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make an Ember.js app offline with server sync when available

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..

like image 273
Orlando Avatar asked Dec 27 '12 21:12

Orlando


1 Answers

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
        }
      })

});
like image 136
khanmizan Avatar answered Oct 20 '22 17:10

khanmizan