Open History to see the last commit
1import { FormApi, type FormOptions, type Validator } from '@tanstack/form-core'
2import { injectStore } from '@tanstack/angular-store'
3β
4export function injectForm<
5 TFormData,
6 TFormValidator extends Validator<TFormData, unknown> | undefined = undefined,
7>(opts?: FormOptions<TFormData, TFormValidator>) {
8 const api = new FormApi<TFormData, TFormValidator>(opts)
9β
10 injectStore(api.store, (state) => state.isSubmitting)
11β
12 return api
13}