UNPKG

@speckle/objectloader2

Version:

This is an updated objectloader for the Speckle viewer written in typescript

33 lines 890 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MemoryDatabase = void 0; class MemoryDatabase { items; constructor(options) { this.items = options?.items || new Map(); } getAll(keys) { const found = []; for (const key of keys) { const item = this.items.get(key); if (item) { found.push({ baseId: key, base: item }); } else { found.push(undefined); } } return Promise.resolve(found); } cacheSaveBatch({ batch }) { for (const item of batch) { this.items.set(item.baseId, item.base); } return Promise.resolve(); } disposeAsync() { return Promise.resolve(); } } exports.MemoryDatabase = MemoryDatabase; //# sourceMappingURL=memoryDatabase.js.map