import { type Writable, writable } from 'svelte/store'

type EnergyData = {
	limit: number,
	target: number
}

async function createStore(): Promise<Writable<EnergyData>> {
	const { subscribe, update, set } = writable({
		limit: 2500,
		target: 2000
	})
	return {
		subscribe,
		update,
		set
	}
}

export const energyStore = await createStore()
