aboutsummaryrefslogtreecommitdiff
path: root/src/stores/actions.js
blob: 3a6d13fbe0ddc8ce62352d21d6768a9c4855d49f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { writable } from 'svelte/store';

/*
 * This is a store to set the actions in the top header.
 */

export const actions = writable({});

export const enableTopicActions = (id) => {

  actions.update((actionsValue) => {

    actionsValue.topic_id = id;
    return actionsValue;
  });
};

export const disableTopicActions = () => {

  actions.update((actionsValue) => {

    delete actionsValue.id;
    return actionsValue;
  });
};