mylingo3d
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
22 lines (18 loc) • 628 B
text/typescript
import store from "@lincode/reactivity"
import Appendable from "../api/core/Appendable"
import { emitSelectionRecompute } from "../events/onSelectionRecompute"
export const [setSelectionFrozen, getSelectionFrozen] = store([
new Set<Appendable>()
])
export const addSelectionFrozen = (item: Appendable) => {
const [frozenSet] = getSelectionFrozen()
frozenSet.add(item)
setSelectionFrozen([frozenSet])
emitSelectionRecompute()
}
export const clearSelectionFrozen = () => {
const [frozenSet] = getSelectionFrozen()
frozenSet.clear()
setSelectionFrozen([frozenSet])
emitSelectionRecompute()
}