import { writable } from 'svelte/store';

interface Store {
	isSignedIn: boolean;
}

const store = writable<Store>({
	isSignedIn: true
});

export const auth = {
	subscribe: store.subscribe,
	signIn: () => {
		store.update((store) => {
			return {
				...store,
				isSignedIn: true
			};
		});
	},
	signOut: () => {
		store.update((store) => {
			return {
				...store,
				isSignedIn: false
			};
		});
	}
}