UNPKG

mylingo3d

Version:

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

18 lines (16 loc) 362 B
import { debounce } from "@lincode/utils" export default () => { const map = new Map<any, () => void>() const run = debounce( () => { for (const cb of map.values()) cb() map.clear() }, 0, "trailing" ) return (item: any, cb: () => void) => { map.set(item, cb) run() } }