frequi_origin/src/shared/storage.ts

13 lines
399 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';
export function saveCustomPlotConfig(plotConfig: PlotConfig) {
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));
}