UNPKG

three

Version:

JavaScript 3D library

27 lines (14 loc) 274 B
let id = 0; class NodeCache { constructor() { this.id = id ++; this.nodesData = new WeakMap(); } getNodeData( node ) { return this.nodesData.get( node ); } setNodeData( node, data ) { this.nodesData.set( node, data ); } } export default NodeCache;