* Gets the current state of the collection as a Map * @returns Map containing all items in the collection, with keys as identifiers * @example * const itemsMap = collection.state * console.log(`Collection has ${itemsMap.size} items`) * * for (const [key, item] of itemsMap) { *
()
| 819 | * } |
| 820 | */ |
| 821 | get state() { |
| 822 | const result = new Map<TKey, WithVirtualProps<TOutput, TKey>>() |
| 823 | for (const [key, value] of this.entries()) { |
| 824 | result.set(key, value) |
| 825 | } |
| 826 | return result |
| 827 | } |
| 828 | |
| 829 | /** |
| 830 | * Gets the current state of the collection as a Map, but only resolves when data is available |
no test coverage detected