You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
369 B
20 lines
369 B
import { writable } from "svelte/store";
|
|
|
|
function createModalStore() {
|
|
const {set, subscribe} = writable({name: null, data: null});
|
|
|
|
return {
|
|
subscribe,
|
|
|
|
open(name, data = {}) {
|
|
console.log("Opening modal", name, data)
|
|
set({name, data});
|
|
},
|
|
|
|
close() {
|
|
set({name: null, data: null})
|
|
},
|
|
}
|
|
}
|
|
|
|
export default createModalStore();
|