Created
June 23, 2015 14:01
-
-
Save chadoh/cd3a6fb3c13145afdb39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ToDo API | |
*/ | |
'use strict'; | |
var DEBUG = true; | |
var _name = 'ToDoApi.js'; | |
var ToDoActions = require('../actions/ToDoActions'); | |
var ToDoData = require('./ToDoData'); | |
module.exports = { | |
// Load mock ToDo data from localStorage | |
initToDoData: function() { | |
ToDoData.init(); | |
var data = JSON.parse(localStorage.getItem('todo')); | |
if (DEBUG) { | |
console.log('[*] ' + _name + ':initToDoData --- '); | |
console.log(data); | |
} | |
ToDoActions.receiveToDo(data); | |
}, | |
toggleCompleteById: function(id) { | |
ToDoActions.toggleComplete(id); | |
}, | |
addNewToDo: function(data) { | |
ToDoActions.addToDo(data); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment