1 import { derived, writable } from 'svelte/store';
2 import type { Readable, Writable } from 'svelte/store';
4 export type Actions = {
8 export type TopicAction = {
13 * This is a store to set the actions in the top header.
16 const actions: Writable<Actions> = writable({});
18 export const enableTopicActions = (id: string) => {
19 actions.update((actionsValue: Actions): Actions => {
20 actionsValue.topic = {
27 export const disableTopicActions = () => {
28 actions.update((actionsValue): Actions => {
29 delete actionsValue.topic;
34 export const topicActions: Readable<TopicAction> = derived(actions, ($actions) => $actions.topic);