chore: convert everything to vue sfc

This commit is contained in:
2018-09-08 16:25:36 -07:00
parent 5e47f71f31
commit 9c4641dd0a
9 changed files with 495 additions and 516 deletions

View File

@@ -0,0 +1,5 @@
import mitt from 'mitt';
const emitter = mitt();
export default emitter;

View File

@@ -0,0 +1,17 @@
/* eslint-env browser */
const storage = (() => {
// return localstorage in the browser env
if (this && this.localStorage) return this.localStorage;
// return a mock localstorage in the server env
return {
getItem: () => null,
setItem: () => null,
};
})();
export default {
get: id => JSON.parse(storage.getItem(id)),
set: (id, val) => storage.setItem(id, JSON.stringify(val)),
};