Sha256: 4786064337c8f5cd1a77edeeb64c2df40fcdfa62ccced33c0b313149c8f6fbb2

Contents?: true

Size: 464 Bytes

Versions: 1

Compression:

Stored size: 464 Bytes

Contents

function LocalStorage(storage_engine) {
  this.storage_engine = storage_engine;
}

LocalStorage.prototype.set = function(key, value) {
  this.storage_engine.setItem(key, LocalStorage.encode(value));
};

LocalStorage.prototype.get = function(key) {
  return LocalStorage.decode(this.storage_engine.getItem(key));
};

LocalStorage.encode = function(value) {
  return JSON.stringify(value);
};

LocalStorage.decode = function(value) {
  return JSON.parse(value);
};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rawq-0.1.0 lib/rawq/templates/public/javascript/local_storage.js