Skeleton starter

For js-skeleton

Skeleton.js starter

First Page Load

On the first page load, we want to fetch saved todos from localStorage, and display them after filtering by the last visited route. So, we retrieve the todos, push them all, retrieve the filter and applying the router on it. Here is the code snippet:

let todos = Skeleton.storage.fetch('todos') || [];
TodosList.pushAll(todos); // push all stored todos
let filter = Skeleton.storage.fetch('filter') || 'all';
router.visit(`/${filter}`); // go to last saved path
Guy Peer

By Guy Peer

I am a web developer. Creator of skeleton.js.

Looking for more js-skeleton tutorials?

View all tutorials for js-skeleton