( component: Component.Any, props: unknown )
| 551 | * @internal |
| 552 | */ |
| 553 | export 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 | } |
no test coverage detected