Skip to content
Permalink
f681d64416
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
23 lines (19 sloc) 501 Bytes
import { readable, type Updater } from "svelte/store";
import type { DialogInfo } from "$lib/types/dialog";
let update: (_: Updater<DialogInfo[]>) => void;
export default readable<DialogInfo[]>(
[],
(_, _update) => { update = _update }
);
export function createDialog(newData: DialogInfo) {
update((popups) => {
popups.push(newData);
return popups;
});
}
export function killDialog() {
update((popups) => {
popups.pop()
return popups;
});
}