Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public pendingNotification: Notification | null = null;
public prevRoute: RouteLocationNormalized | null = null;
public sidebar = true;
public theme: string | null = null;
public timeRange: TimeRange | null = null;
public timezoneUTC = false;
}
const state = new State();
const store = createStore({
state,
mutations: Object.getOwnPropertyNames(state).reduce((tree: MutationTree, name: string) => {
tree[name] = (state: State, value: unknown): void => {
(state as any)[name] = value;
};
return tree;
}, {}),
plugins: [persist()],
});
function persist() {
const save = (state: State): void => {
localStorage.setItem(
persistKey,
JSON.stringify({
autoPropagate: state.autoPropagate,