PHP Classes

File: public/js/app/vue-todo/models/store.js

Recommend this page to a friend!
  Classes of Sergey Beskorovayniy  >  Silex MVC Blog  >  public/js/app/vue-todo/models/store.js  >  Download  
File: public/js/app/vue-todo/models/store.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Silex MVC Blog
MVC based blog using on the Silex micro-framework
Author: By
Last change:
Date: 5 years ago
Size: 392 bytes


Class file image Download
define([], function () {
    var STORAGE_KEY = 'todos-vuejs';

    // Methods
    var fetch = function () {
        return JSON.parse(localStorage.getItem(STORAGE_KEY) || '[]');
    var save = function (todos) {
        localStorage.setItem(STORAGE_KEY, JSON.stringify(todos));

    // Exposed public methods
    return {
        fetch: fetch,
        save: save
For more information send a message to info at phpclasses dot org.