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) => {
20 actions.update((actionsValue: Actions): Actions => {
22 actionsValue.topic = {
29 export const disableTopicActions = () => {
31 actions.update((actionsValue): Actions => {
33 delete actionsValue.topic;
38 export const topicActions: Readable<TopicAction> = derived(
40 ($actions) => $actions.topic