Ninja Pirate Marksman

    ember-indexeddb-adapter

    0.1.2 • Public • Published

    Ember Data IndexedDB Adapter

    This is an adapter for Ember Data that lets you store your application data offline using IndexedDB.

    • To know more about Ember Data, click here.
    • To know more about IndexedDB, click here.

    Compatibility

    This adapter aligns itself with the latest Ember CLI release and it's corresponding Ember Data version.

    As of the moment, the latest version is compatible with Ember CLI v1.13.12.

    Usage

    To install this addon using Ember CLI, use this command:

    $ ember install ember-indexeddb-adapter

    After installing the addon, generate the app adapter by using this command:

    $ ember generate adapter application

    We then override the adapter similar to this:

    //app/adapters/application.js
    import IndexedDBAdapter from 'ember-indexeddb-adapter/adapters/indexeddb';
     
    export default IndexedDBAdapter.extend({
      /**
       * Name of your IndexedDB
       * @type {string} 
       */
      dbName: 'DummyDatabase',
     
      /**
       * Version of your IndexedDB.
       * If you have an existing IDB and you want to update it's schema, the value
       * of this variable should be higher than the version of your existing IDB.
       * @type {number} 
       */
      version: 1,
     
      /**
       * Array containing the name of your models.
       * @type {Array.<string>} 
       */
      models: ['user', 'post']
    });

    Keywords

    Install

    npm i ember-indexeddb-adapter

    DownloadsWeekly Downloads

    1

    Version

    0.1.2

    License

    MIT

    Last publish

    Collaborators

    • nullvoxpopuli
    • alonbukai