diff --git a/app/components/App.js b/app/components/App.js index b1f8715..cf0cba1 100644 --- a/app/components/App.js +++ b/app/components/App.js @@ -252,7 +252,7 @@ export default class App extends React.Component { } @@ -296,3 +296,19 @@ export default class App extends React.Component { ); } } + +const _storages = {}; + +function _makeStorage(storageKey) { + return { + setItem: (key, val) => window.localStorage.setItem(`${storageKey}${key}`, val), + getItem: (key) => window.localStorage.getItem(`${storageKey}${key}`) + }; +} + +function getStorage(storageKey) { + if (!_storages[storageKey]) { + _storages[storageKey] = _makeStorage(storageKey); + } + return _storages[storageKey]; +} diff --git a/package.json b/package.json index 8d01783..3ad9f88 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "url": "https://github.com/skevy/graphiql-app/issues" }, "dependencies": { - "graphiql": "^0.3.0", + "graphiql": "skevy/graphiql#redbox", "graphql": "^0.4.7", "isomorphic-fetch": "^2.1.1", "lodash": "^3.10.1",