d1e8243c47
* Zod EVERYWHERE * Add no-unused-vars rule to eslint in front * Add no-unused-vars rule to eslint in pusher * Add no-unused-vars rule to eslint in back * Remove unused PlayerTexture guards * Fix data providing on room connection Co-authored-by: Alexis Faizeau <a.faizeau@workadventu.re>
21 lines
449 B
TypeScript
21 lines
449 B
TypeScript
import { writable } from "svelte/store";
|
|
|
|
/**
|
|
* A store that contains the URL of the sound currently playing
|
|
*/
|
|
function createSoundPlayingStore() {
|
|
const { subscribe, set } = writable<string | null>(null);
|
|
|
|
return {
|
|
subscribe,
|
|
playSound: (url: string) => {
|
|
set(url);
|
|
},
|
|
soundEnded: () => {
|
|
set(null);
|
|
},
|
|
};
|
|
}
|
|
|
|
export const soundPlayingStore = createSoundPlayingStore();
|