Liking cljdoc? Tell your friends :D

f-form.form

Functions for creating and upating a form, an immutable collection of related f-form.fields which will be validated together.

A form usually corresponds to an html <form> tag. Or to be more precise, one <form> is built out of one or more f-form.forms.

Functions for creating and upating a form, an immutable collection of related
[[f-form.field]]s which will be validated together.

A form usually corresponds to an html `<form>` tag. Or to be more precise, one
`<form>` is built out of one or more f-form.forms.
raw docstring

add-fieldclj/s

(add-field form field)

Add a new field to a form.

Add a new `field` to a `form`.
sourceraw docstring

changesclj/s

(changes form)

A nested hashmap containing only the values of the fields with changes. The keypaths into the returned hashmap are the :field/paths.

Only works if the fields' trackers have been tracking :field/pristine?. Otherwise returns all values.

A nested hashmap containing only the values of the fields with changes. The
keypaths into the returned hashmap are the `:field/path`s.

Only works if the fields' trackers have been tracking `:field/pristine?`.
Otherwise returns all values.
sourceraw docstring

field-by-pathclj/s

(field-by-path form path)

Returns the field in the form stored at the given path.

Returns the field in the `form` stored at the given `path`.
sourceraw docstring

field-valuesclj/s

(field-values fields)

Helper: A nested hashmap containing the values of the fields. The keypaths into the returned hashmap are the :field/paths.

NOTE: this function expects the fields, as via (fields form), not the whole form.

_Helper:_ A nested hashmap containing the values of the fields. The keypaths into the
returned hashmap are the `:field/path`s.

NOTE: this function expects the fields, as via `(fields form)`, not the whole
form.
sourceraw docstring

fieldsclj/s

(fields form)
(fields form xf)

A seq of the fields on the form, optionally filtered with xf.

A seq of the fields on the `form`, optionally filtered with `xf`.
sourceraw docstring

initclj/s

(init)
(init fields)
(init base fields)

Create a form containing the given fields.

The base, if provided, is the initial value of the form before it is given any fields, and can be a place to hold extra data. Avoid conflicts by using keys from a namespace besides form.

Create a form containing the given `fields`.

The `base`, if provided, is the initial value of the form before it is given
any fields, and can be a place to hold extra data. Avoid conflicts by using
keys from a namespace besides `form`.
sourceraw docstring

remove-field-by-pathclj/s

(remove-field-by-path form path)

Remove a field from the form.

Remove a field from the `form`.
sourceraw docstring

submittedclj/s

(submitted form)

Mark that the form is done being submitted.

Mark that the `form` is done being submitted.
sourceraw docstring

submittingclj/s

(submitting form)

Mark that the form is being submitted to an external service.

Mark that the `form` is being submitted to an external service.
sourceraw docstring

submitting?clj/s

(submitting? form)

Check whether the form is currently being submitted.

Check whether the `form` is currently being submitted.
sourceraw docstring

update-field-by-pathclj/s

(update-field-by-path form path f & args)

Update a field at the provided path, as with clojure.core/update. If the field does not exist, the update is ignored.

Update a field at the provided `path`, as with `clojure.core/update`. If
the field does not exist, the update is ignored.
sourceraw docstring

value-by-pathclj/s

(value-by-path form path)

Returns the :field/value of the field stored in the form at the given path.

Returns the `:field/value` of the field stored in the `form` at the given
`path`.
sourceraw docstring

valuesclj/s

(values form)
(values form xf)

A nested hashmap containing the values of all fields, optionally filtered by xf. The keypaths into the returned hashmap are the :field/paths.

A nested hashmap containing the values of all fields, optionally filtered by
`xf`. The keypaths into the returned hashmap are the `:field/path`s.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close