Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
class Form
import { Form } from "https://deno.land/x/frugal@0.5.0/packages/preact/mod.client.ts";

Constructors

new
Form(config: FormConfig<VALUE>, state: FormState<VALUE>)

Type Parameters

optional
VALUE extends FormValue = any

Properties

readonly
isSubmiting
readonly
isValidating
readonly
state
readonly
submitCounter
readonly
success
readonly
valid
readonly
value

Methods

_validationStrategy(event: "change" | "touch" | "submit")
addListener(listener: Listener)
field<KEY extends keyof VALUE>(key: KEY): Field<VALUE[KEY]>
handle(): Promise<VALUE | undefined>
removeListener(listener: Listener)
submit(formElement: HTMLFormElement): Promise<void>

Static Methods

fromState<VALUE extends FormValue>(config: FormConfig<VALUE>, state: FormState<VALUE>): Form<VALUE>
fromValue<VALUE extends FormValue>(config: FormConfig<VALUE>, value?: VALUE): Form<VALUE>