This library provides a number of convenience helpers for use with Reagent.
reagent.cookies
get-raw
(get-raw k & [default])
gets the value at the key (as string), optional default when value is not found
remove!
(remove! k)(remove! k path domain)
removes a cookie, optionally for a specific path and/or domain
set!
(set! k content & [{:keys [max-age path domain secure? raw?]} :as opts])
sets a cookie, the max-age for session cookie following optional parameters may be passed in as a map: :max-age - defaults to -1 :path - path of the cookie, defaults to the full request path :domain - domain of the cookie, when null the browser will use the full request host name :secure? - boolean specifying whether the cookie should only be sent over a secure channel :raw? - boolean specifying whether content should be stored raw, or as EDN
reagent.format
format
(format fmt & args)
Formats a string using goog.string.format. e.g: (format "Cost: %.2f" 10.0234)
reagent.session
assoc-in!
(assoc-in! ks v)
Associates a value in the session, where ks is a sequence of keys and v is the new value and returns a new nested structure. If any levels do not exist, hash-maps will be created.
get!
(get! k & [default])
Destructive get from the session. This returns the current value of the key and then removes it from the session.
get-in
(get-in ks & [default])
Gets the value at the path specified by the vector ks from the session, returns nil if it doesn't exist.
get-in!
(get-in! ks & [default])
Destructive get from the session. This returns the current value of the path specified by the vector ks and then removes it from the session.
swap!
(swap! f & args)
Replace the current session's value with the result of executing f with the current value and args.
reagent.validation
Functions for validating input and setting string errors on fields.
has-values?
(has-values? coll)
Returns true if all members of the collection has-value? This works on maps as well.