CrossClj

0.3.2 docs

SourceDocs


project

docs index

NAMESPACES
lomakkeet

RECENT
    VARS
    ->fs
    change-value
    coerce
    commit
    default-explain-error
    dirty?
    errors?
    extra-validation
    FormState
    reset
    save
    update
    validate
    validation-error->str
    value

    « Index of all namespaces of this project

    (->fs ???)(->fs ???)
    (change-value ???)(change-value ???)(change-value ???)(change-value ???)
    Takes fs, schema, vector of keywords and new value.
    
    If new value is nil, schema is checked if value is in optional-key,
    value it is, instead of setting value to nil, the key is dissoced.
    (coerce schema value coercion-matcher)
    Return either coerced or the original value if the coercion failed.
    
    (commit fs)
    Commit the changes in value to the initial-value of the form.
    
    (default-explain-error error)
    Should convert error from e.g. predicate to single word.
    
    (not (required "")) => "required"
    (dirty? fs)
    Check if form-state is dirty, meaning that the value and the initial value are not identitcal.
    
    (errors? fs)
    Check if form has any errors.
    
    (extra-validation fs validation-fn)
    (reset fs)
    Reset the value of form to initial value.
    
    (save fs value)
    Set a new value to form. This will trigger a schema validation for the value.
    Doesn't trigger commit.
    (update fs f & args)
    Use a function to set a new value to form. This changes both the value and the initial value.
    The function is called with the value as the first parameter and rest of arguemtns
    are passed to the function (Like update-in).
    (validation-error->str v)
    (value fs & kws)