(docId: string, id: string, instances: ComponentInstance[] | null)
| 432 | |
| 433 | @action |
| 434 | setInstance(docId: string, id: string, instances: ComponentInstance[] | null) { |
| 435 | if (!Object.prototype.hasOwnProperty.call(this.instancesMap, docId)) { |
| 436 | this.instancesMap[docId] = new Map() |
| 437 | } |
| 438 | if (instances == null) { |
| 439 | this.instancesMap[docId].delete(id) |
| 440 | } else { |
| 441 | this.instancesMap[docId].set(id, instances.slice()) |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | getInstance(docId: string, id: string) { |
| 446 | return this.instancesMap[docId]?.get(id)?.[0] |
no test coverage detected