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

Function buildWith

packages/effect/src/ui/View.ts:624–640  ·  view source on GitHub ↗
(
  builder: ElementBuilder<Msg, any, any, any>,
  given: ReadonlyArray<Node<Msg, any>>
)

Source from the content-addressed store, hash-verified

622): Element<Msg, R | Requirements<C[number]>> => buildWith(builder, inputs.length === 0 ? noChildren : children(inputs))
623
624const buildWith = <Msg, R>(
625 builder: ElementBuilder<Msg, any, any, any>,
626 given: ReadonlyArray<Node<Msg, any>>
627): Element<Msg, R> => {
628 // What the builder holds from `children` comes first, and what it is
629 // given now comes after.
630 const content = builder.content
631 const all = content === undefined
632 ? given
633 : given.length === 0
634 ? content
635 : children([...content, ...given])
636 const hooks = builder.hooks
637 return hooks === undefined
638 ? elementOf(builder, all)
639 : forwardTo(builder, hooks, all)
640}
641
642const elementOf = <Msg, R>(
643 builder: ElementBuilder<Msg, any, any, any>,

Callers 2

toNodeFunction · 0.85
buildFunction · 0.85

Calls 3

forwardToFunction · 0.85
childrenFunction · 0.70
elementOfFunction · 0.70

Tested by

no test coverage detected