Skip to content

makeValidatable

makeValidatable<T, Expr>(target, expr, handler, opt?): () => void

Defined in: validator.ts:39

Make a target object validatable

It's just a shorthand of:

Validator.get(target).addAsyncHandler(expr, handler, opt)

T extends object

T

The target object

() => Expr

The expression to observe

Validator.AsyncHandler<T, NoInfer<Expr>>

The async handler to call when the expression changes

Validator.HandlerOptions<NoInfer<Expr>>

The handler options

A function to remove the handler

() => void

If you're using make(Auto)Observable, make sure to call makeValidatable after make(Auto)Observable.

makeValidatable<T>(target, handler, opt?): () => void

Defined in: validator.ts:63

Make a target object validatable

It's just a shorthand of:

Validator.get(target).addSyncHandler(handler, opt)

T extends object

T

The target object

Validator.SyncHandler<T>

The sync handler containing observable expressions

Validator.HandlerOptions<unknown>

The handler options

A function to remove the handler

() => void

If you're using make(Auto)Observable, make sure to call makeValidatable after make(Auto)Observable.