Add persistent store

This commit is contained in:
Anders Englöf Ytterström 2025-02-03 15:54:18 +01:00
parent 0f76b8b799
commit ab91fc462c

View file

@ -1,12 +1,14 @@
import { writable } from "svelte/store";
import { persisted } from "svelte-persisted-store";
import defaultState from "../../data/default-state";
export const cardio = writable(Array<Exercise>);
export const gym = writable(Array<Exercise>);
export const currentView = writable(0);
export const count = writable(0);
export const cardio = persisted("cardio", defaultState.cardio);
export const gym = persisted("gym", defaultState.gym);
export const diet = persisted("diet", defaultState.diet);
type Exercise = {
export type Exercise = {
completed: boolean;
name: string;
text: string;