Kontra.store

A simple interface to local storage based on store.js, whose sole purpose is to ensure that any keys you save to local storage come out the same type as when they went in.

Normally when you save something to local storage, it converts it into a string. So if you were to save a number, it would be saved as "12" instead of 12. This means when you retrieved the number, it would now be a string.

kontra.store.set('highScore', 100);

kontra.store.get('highScore');  //=> 100

Table of Contents

kontra.store​.get(key)

key {string}
Key to retrieve.

Get a keys value from local storage.

kontra.store​.set(key, value)

key {string}
Key to set.
value {*}
Value to add.

Add or update a keys value in local storage.