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