Liking cljdoc? Tell your friends :D

bangmod.form.core

clj

Macro half of bangmod.form.core; core.cljs pulls it in with :require-macros, so [bangmod.form.core :as form] gives form/create-form-submission with nothing extra.

Macro half of `bangmod.form.core`; `core.cljs` pulls it in with `:require-macros`, so
`[bangmod.form.core :as form]` gives `form/create-form-submission` with nothing extra.
raw docstring

create-failed-submission-resultcljs

(create-failed-submission-result error-msg)
source

create-formcljs

(create-form form-id)
(create-form form-id options)
source

create-form-submissionclj/smacro

(create-form-submission form binding & body)

Builds a form's :on-submit handler. Reads like a fn with the form in front:

(form/create-form-submission login-form [form values dispatch] (let [{:keys [email password]} values] (dispatch (-> (ch->promise (http-api/raw-execute :auth :login {:params {...}})) (.then (fn [{:keys [success? data]}] (when-not success? (:message data))))))))

The binding vector is exactly [form values dispatch] — each may destructure. The body runs once per valid submit (every field touched, none in error, no submission already in flight) and must call dispatch exactly once with nil (success), a string (the form-level error) or a promise resolving to either. Anything else — another value, a second call, a rejected promise, a promise resolving to something else, or never calling dispatch at all — marks the form failed with the error's message and throws. See bangmod.form.submission/handler for the runtime.

Builds a form's `:on-submit` handler. Reads like a `fn` with the form in front:

  (form/create-form-submission login-form [form values dispatch]
    (let [{:keys [email password]} values]
      (dispatch (-> (ch->promise (http-api/raw-execute :auth :login {:params {...}}))
                    (.then (fn [{:keys [success? data]}]
                             (when-not success? (:message data))))))))

The binding vector is exactly `[form values dispatch]` — each may destructure. The body
runs once per valid submit (every field touched, none in error, no submission already
in flight) and must call `dispatch` exactly once with nil (success), a string (the
form-level error) or a promise resolving to either. Anything else — another value, a
second call, a rejected promise, a promise resolving to something else, or never
calling `dispatch` at all — marks the form failed with the error's message and throws.
See `bangmod.form.submission/handler` for the runtime.
sourceraw docstring

create-success-submission-resultcljs

(create-success-submission-result)
source

FieldArraycljs

source

FieldGroupcljs

source

get-formcljs

The form registered under form-id. Throws if there is none.

The form registered under `form-id`. Throws if there is none.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close