mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
* Prettier all the JS files * Add GitHub Action to autoformat code pushed to master * Fix eslint violation due to formatting. * Remove GitHub actions for styling * Add restyled.io config
20 lines
401 B
JavaScript
20 lines
401 B
JavaScript
const PREFIX = "localOptions:";
|
|
|
|
function get(key, defaultValue = undefined) {
|
|
const fullKey = PREFIX + key;
|
|
if (fullKey in window.localStorage) {
|
|
return JSON.parse(window.localStorage.getItem(fullKey));
|
|
}
|
|
return defaultValue;
|
|
}
|
|
|
|
function set(key, value) {
|
|
const fullKey = PREFIX + key;
|
|
window.localStorage.setItem(fullKey, JSON.stringify(value));
|
|
}
|
|
|
|
export default {
|
|
get,
|
|
set,
|
|
};
|