File size: 425 Bytes
39e315a
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import type { Command } from '../commands.js'
import { createStore } from './store.js'

const pluginCommandsStore = createStore<Command[]>([])

export const getPluginCommandsState = (): Command[] =>
  pluginCommandsStore.getState()

export const subscribePluginCommands = pluginCommandsStore.subscribe

export function setPluginCommandsState(commands: Command[]): void {
  pluginCommandsStore.setState(() => [...commands])
}