diff --git a/src/stores/authStore.ts b/src/stores/authStore.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/stores/channelStore.ts b/src/stores/channelStore.ts new file mode 100644 index 00000000..4339f5f2 --- /dev/null +++ b/src/stores/channelStore.ts @@ -0,0 +1,24 @@ +import { derived, writable, type Writable } from "svelte/store" + +class ChannelStore { + constructor( + public firstname: Writable = writable(''), + public lastname: Writable = writable(''), + ) { } + + get fullname() { + // Use derived to access writable values and export as readonly + return derived( + [this.firstname, this.lastname], + ([$firstName, $lastName]) => { + return $firstName + " " + $lastName + } + ) + } +} + +// Export a singleton +export const myFormStore = new ChannelStore() + +// Allow for multiple stores (good for contexts) +// export const createMyFormStore = () => new MyFormStore(); \ No newline at end of file diff --git a/src/stores/streamStore.ts b/src/stores/streamStore.ts new file mode 100644 index 00000000..e69de29b