]> git.r.bdr.sh - rbdr/forum/blame - src/stores/actions.js
Update sveltekit version
[rbdr/forum] / src / stores / actions.js
CommitLineData
55fb920b 1import { derived, writable } from 'svelte/store';
58f7d521
RBR
2
3/*
4 * This is a store to set the actions in the top header.
5 */
6
26dfa00e 7const actions = writable({});
58f7d521
RBR
8
9export const enableTopicActions = (id) => {
10
11 actions.update((actionsValue) => {
12
55fb920b
RBR
13 actionsValue.topic = {
14 id
15 };
58f7d521
RBR
16 return actionsValue;
17 });
18};
19
20export const disableTopicActions = () => {
21
22 actions.update((actionsValue) => {
23
55fb920b 24 delete actionsValue.topic;
58f7d521
RBR
25 return actionsValue;
26 });
27};
55fb920b
RBR
28
29export const topicActions = derived(
30 actions,
31 ($actions) => $actions.topic
32);