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