5180 fichiers 38.5 Mo 0 téléchargements 221 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / hooks / wired-tools / useWiredToolsActions.ts
useWiredToolsActions.ts 1.8 Ko Télécharger le fichier
import { useSharedHook } from '@/state/useSharedHook';
import { useWiredToolsStore } from './useWiredToolsStore';

/**
 * Imperative slice of the Wired tools store: state-mutating actions
 * (assignXxx / removeXxx / updateXxx) plus the link-event openers
 * (openMonitor / openInspectionForFurni / openInspectionForUser) and
 * the persistence helpers (saveRoomSettings, updateAccountPreferences,
 * requestUserVariables).
 *
 * Stays separate from useWiredToolsState so components that only need
 * to trigger Wired actions don't have to pull in the full state shape.
 */
export const useWiredToolsActions = () => {
    const {
        updateAccountPreferences,
        setPlayTestMode,
        togglePlayTestMode,
        updateWiredWhisperDisabled,
        saveRoomSettings,
        saveRoomTimezone,
        reloadRoomWired,
        rollbackRoomWired,
        requestUserVariables,
        assignUserVariable,
        removeUserVariable,
        updateUserVariableValue,
        assignFurniVariable,
        removeFurniVariable,
        clearVariableForAllHolders,
        updateFurniVariableValue,
        updateRoomVariableValue,
        openMonitor,
        openInspectionForFurni,
        openInspectionForUser
    } = useSharedHook(useWiredToolsStore);

    return {
        updateAccountPreferences,
        setPlayTestMode,
        togglePlayTestMode,
        updateWiredWhisperDisabled,
        saveRoomSettings,
        saveRoomTimezone,
        reloadRoomWired,
        rollbackRoomWired,
        requestUserVariables,
        assignUserVariable,
        removeUserVariable,
        updateUserVariableValue,
        assignFurniVariable,
        removeFurniVariable,
        clearVariableForAllHolders,
        updateFurniVariableValue,
        updateRoomVariableValue,
        openMonitor,
        openInspectionForFurni,
        openInspectionForUser
    };
};
15Sujets
1Dépôts
20Membres
2En 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