5180 fichiers 38.5 Mo 0 téléchargements 114 vues mis à jour il y a 4 heures ui
nitro-v36-with-renderer-v36 / src / state / variablesExplorer.ts
variablesExplorer.ts 882 o Télécharger le fichier
import { createOctaneStore } from './createOctaneStore';

export interface VariablesExplorerPrefill {
    roomId?: number;
    readKey?: string;
    writeKey?: string;
}

interface VariablesExplorerState {
    isOpen: boolean;
    prefill: VariablesExplorerPrefill | null;
    /** Bumped on every open, so an open window takes a new prefill. */
    openCount: number;
    open: (prefill?: VariablesExplorerPrefill) => void;
    close: () => void;
}

/** The Variables Explorer window, opened from the web api box editor and the wired creator tools. */
export const useVariablesExplorerStore = createOctaneStore<VariablesExplorerState>()((set) => ({
    isOpen: false,
    prefill: null,
    openCount: 0,
    open: (prefill) => set((state) => ({ isOpen: true, prefill: prefill ?? null, openCount: state.openCount + 1 })),
    close: () => set({ isOpen: false, prefill: null })
}));
15Sujets
1Dépôts
20Membres
7En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser