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

Function fromIterable

packages/effect/src/TxHashMap.ts:337–344  ·  view source on GitHub ↗
(
  entries: Iterable<readonly [K, V]>
)

Source from the content-addressed store, hash-verified

335 * @since 2.0.0
336 */
337export const fromIterable = <K, V>(
338 entries: Iterable<readonly [K, V]>
339): Effect.Effect<TxHashMap<K, V>> =>
340 Effect.gen(function*() {
341 const hashMap = HashMap.fromIterable(entries)
342 const ref = yield* TxRef.make(hashMap)
343 return Object.assign(Object.create(TxHashMapProto), { ref })
344 })
345
346/**
347 * Looks up the value for the specified key in the TxHashMap.

Callers

nothing calls this directly

Calls 2

assignMethod · 0.80
makeMethod · 0.65

Tested by

no test coverage detected