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

Function initial

packages/effect/src/ui/internal/steps.ts:553–584  ·  view source on GitHub ↗
(
  component: Component.Any,
  props: unknown
)

Source from the content-addressed store, hash-verified

551 * @internal
552 */
553export const initial = (
554 component: Component.Any,
555 props: unknown
556): engine.State<any, any, any, any> => {
557 const first = component.init(props)
558 const fields: engine.Fields<any, any, any, any> = {
559 // The record is stored with its types erased; each kind's cursor restores them.
560 component: component as Component.Component<
561 any,
562 any,
563 any,
564 any,
565 any,
566 any,
567 any,
568 any,
569 never
570 >,
571 props,
572 model: first.model,
573 results: undefined,
574 pending: [],
575 emitted: [],
576 sent: [],
577 interrupted: [],
578 loadingMore: [],
579 defaultPrevented: false,
580 ack: engine.noAck
581 }
582 const empty = engine.record(fields, () => engine.expandedView(fields))
583 return engine.apply(empty, first)
584}

Callers 8

exploreFunction · 0.90
reduceWhileFunction · 0.50
reduceWhileEffectFunction · 0.50
reduceWhileArrayFunction · 0.50
reduceWhileArrayEffectFunction · 0.50
reduceArrayFunction · 0.50
Channel.tsFile · 0.50
Stream.tsFile · 0.50

Calls 3

initMethod · 0.65
recordMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected