frequi_origin/src/shared/storage.ts

13 lines
400 B
TypeScript
Raw Normal View History

2020-06-30 19:00:29 +00:00
import { PlotConfig, EMPTY_PLOTCONFIG } from '@/types';
const PLOT_CONFIG = 'ft_custom_plot_config';
2020-08-07 04:58:47 +00:00
export function storeCustomPlotConfig(plotConfig: PlotConfig) {
2020-06-30 19:00:29 +00:00
localStorage.setItem(PLOT_CONFIG, JSON.stringify(plotConfig));
}
export function loadCustomPlotConfig() {
console.log('load_custom');
return JSON.parse(localStorage.getItem(PLOT_CONFIG) || JSON.stringify(EMPTY_PLOTCONFIG));
}