UNPKG

@cursorify/react

Version:

Customizable cursor component for any style 🕹️

46 lines (45 loc) 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useUpdateCursorify = void 0; const CursorifyProvider_1 = require("../components/CursorifyProvider"); const useUpdateCursorify = () => { const dispatch = (0, CursorifyProvider_1.useCursorifyDispatch)(); const updateCursor = (cursor) => { dispatch({ type: 'UPDATE_CURSOR', payload: cursor, }); }; const updateDelay = (delay) => { dispatch({ type: 'UPDATE_DELAY', payload: delay, }); }; const updateOpacity = (opacity) => { dispatch({ type: 'UPDATE_OPACITY', payload: opacity, }); }; const updateDefaultCursorVisible = (defaultCursorVisible) => { dispatch({ type: 'UPDATE_VISIBLE_DEFAULT_CURSOR', payload: defaultCursorVisible, }); }; const updateEnabled = (enabled) => { dispatch({ type: 'UPDATE_ENABLED', payload: enabled, }); }; return { updateCursor, updateDelay, updateOpacity, updateDefaultCursorVisible, updateEnabled, }; }; exports.useUpdateCursorify = useUpdateCursorify;