Giter Club home page Giter Club logo

hokan's Introduction

hokan

hokan is a package of AMD modules that provide tools to work with persistent local storage. In particular it provides a Dojo Store API interface to persistent local storage.

compliant

Requirements

The modules provided here should work with Dojo Core 1.8 or later.

License

This code is licensed under the "New" BSD License.

Installation

hokan can be installed via cpm, volo or npm, or simply downloaded.

Via cpm:

$ cpm install hokan

Via volo:

$ volo add kitsonk/hokan

Via npm:

$ npm install hokan

Modules

Please refer to the documentation for each of the modules for specifics of their usage:

  • LocalStorage - A Dojo Store API interface to DOM Storage's localStorage
  • IndexedDB - A Dojo Store API interface to IndexedDB
  • idbQueryEngine - A Dojo Store API query engine that supports querying IndexedDB cursors
  • util - Utility functions for hokan

Testing

Unit tests require the D.O.H. installed and are located in the tests path.

hokan's People

Contributors

dylans avatar kitsonk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dylans rgcl k2s

hokan's Issues

Grid Demo

Is there any way to load an IDB object store and display it in an OnDemandGrid with dgrid? Sorry if this was an easy question but I can't quite get it to work.

Thanks!

Sync API

There needs to be an API which allows synchronisation across Dojo Store API stores.

This should be "easy" to accomplish for a default behaviour. For example, the following should "just work":

require(['hokan/sync', 'dojo/store/JsonRest', 'hokan/IndexedDB',
    'dojo/store/Memory'],
function (sync, JsonRest, IndexedDB, Memory) {
  var remote = JsonRest({
    target: '/books'
  });
  var persistent = IndexedDB({
    name: 'books'
  });
  var memory = Memory();

  // the resulting store reads in a "waterfall" from right to left and persists across all stores
  // which is very similar to dojo/store/Cache.
  var store = sync(remote, persistent, memory);

  store.get(1).then(function (book) {
    console.log(book);
  });
});

But beyond that, there are some critical concepts that should be available:

  • The concept of "staleness" for records, where even if an object is stored further down the chain, it can be waterfalled up the chain.
  • The concept of "offline" mode, where transactions against the "offline" store are persisted and flushed when no longer offline.
  • The concepts of coordinated "keys" where the key of the object in one store may need to be translated to a different key when dealing with the other store.
  • A conflict API, where conflicts are identified, handed off for resolution and a merged object is returned.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.