import type { Readable, Writable } from 'svelte/store';
export type Actions = {
- topic?: TopicAction
+ topic?: TopicAction;
};
export type TopicAction = {
- id: string
+ id: string;
};
/*
const actions: Writable<Actions> = writable({});
export const enableTopicActions = (id: string) => {
-
- actions.update((actionsValue: Actions): Actions => {
-
- actionsValue.topic = {
- id
- };
- return actionsValue;
- });
+ actions.update((actionsValue: Actions): Actions => {
+ actionsValue.topic = {
+ id
+ };
+ return actionsValue;
+ });
};
export const disableTopicActions = () => {
-
- actions.update((actionsValue): Actions => {
-
- delete actionsValue.topic;
- return actionsValue;
- });
+ actions.update((actionsValue): Actions => {
+ delete actionsValue.topic;
+ return actionsValue;
+ });
};
-export const topicActions: Readable<TopicAction> = derived(
- actions,
- ($actions) => $actions.topic
-);
+export const topicActions: Readable<TopicAction> = derived(actions, ($actions) => $actions.topic);