(formTree, options)
| 22 | import {REGISTER_WEBMCP_FORM, RegisterWebMcpForm} from './tokens'; |
| 23 | |
| 24 | const registerWebMcpForm: RegisterWebMcpForm = (formTree, options) => { |
| 25 | const injector = inject(Injector); |
| 26 | |
| 27 | // we want to defer the registration until the context is fully initialized, |
| 28 | // This is especially useful if the form model is a derivation of a required input |
| 29 | return new Promise<void>((resolve, reject) => { |
| 30 | effect(() => { |
| 31 | untracked(() => { |
| 32 | initWebMcpForm(formTree, options, injector).then(resolve, reject); |
| 33 | }); |
| 34 | }); |
| 35 | }); |
| 36 | }; |
| 37 | |
| 38 | async function initWebMcpForm( |
| 39 | formTree: FieldTree<unknown>, |
no test coverage detected