Tryig to fix webpack for Svelte

This commit is contained in:
David Négrier 2021-05-12 15:57:53 +02:00
parent 9bc79c3ed3
commit 62cc1f73ca
3 changed files with 26 additions and 5 deletions

View file

@ -0,0 +1,22 @@
import { derived, writable, Writable } from "svelte/store";
class RequestedConstraintsStore {
constructor(
public camera: Writable<boolean> = writable(false),
public microphone: Writable<boolean> = writable(false),
) { }
get fullname() {
// Use derived to access writable values and export as readonly
return derived(
[this.camera, this.microphone],
([$camera, $microphone]) => {
console.log("cam or mic", $camera || $microphone)
return $camera || $microphone;
}
)
}
}
// Export a singleton
export const myFormStore = new MyFormStore();