Add persistent store
This commit is contained in:
parent
0f76b8b799
commit
ab91fc462c
1 changed files with 6 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue