UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

23 lines 1.02 kB
import { event } from "@lincode/events"; import { createEffect } from "@lincode/reactivity"; import { getSelectionTarget } from "../states/useSelectionTarget"; import { selectionTargetPtr } from "../pointers/selectionTargetPtr"; import { selectionRedirectMap } from "../collections/selectionRedirectMap"; import throttleFrameTrailing from "../throttle/utils/throttleFrameTrailing"; import { addDeselectSystem, deleteDeselectSystem } from "../systems/eventSystems/deselectSystem"; const [_emitSelectionTarget, onSelectionTarget] = event(); export { onSelectionTarget }; export const emitSelectionTarget = throttleFrameTrailing((target, noDeselect) => _emitSelectionTarget({ target: (target && selectionRedirectMap.get(target)) ?? target, noDeselect })); createEffect(() => { const [target] = selectionTargetPtr; if (!target) return; addDeselectSystem(target); return () => { deleteDeselectSystem(target); }; }, [getSelectionTarget]); //# sourceMappingURL=onSelectionTarget.js.map