import { writable } from 'svelte/store';


// look in api/login.js and client/pages/Login.svelte for where this is initially setup
export const user = writable({
  authenticated: undefined, // yes, this is on purpose
});

export const cache = writable({
  courses: {},
  modules: {},
  lessons: {},
  recents: {}
});

export const cache_reset = () => {
  cache.update(() => ({
    courses: {},
    modules: {},
    lessons: {},
    recents: {}
  }));
}

export const video_config = writable({video_ready: false});

export const darkmode = writable({theme: "light"});
