MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromIterable

Function fromIterable

packages/effect/src/internal/stm/tMap.ts:194–201  ·  view source on GitHub ↗
(iterable: Iterable<readonly [K, V]>)

Source from the content-addressed store, hash-verified

192
193/** @internal */
194export const fromIterable = <K, V>(iterable: Iterable<readonly [K, V]>): STM.STM<TMap.TMap<K, V>> =>
195 stm.suspend(() => {
196 const data = Chunk.fromIterable(iterable)
197 const capacity = data.length < InitialCapacity
198 ? InitialCapacity
199 : nextPowerOfTwo(data.length)
200 return allocate(capacity, data)
201 })
202
203/** @internal */
204export const get = dual<

Callers 2

emptyFunction · 0.70
makeFunction · 0.70

Calls 2

nextPowerOfTwoFunction · 0.85
allocateFunction · 0.70

Tested by

no test coverage detected