Created
January 10, 2016 11:12
-
-
Save geraldodev/fd6c61eac7ab4b37c616 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-in-link | |
"Wrapper around get-in for looking up for idents. if ks is nil it return the not-found value which is an empty map. That protects you from getting the entire state on a nested component." | |
([m ks] | |
(get-in-link m ks {})) | |
([m ks not-found] | |
(if (nil? ks) | |
not-found | |
(get-in m ks not-found)))) | |
(defmethod read :form-cliente | |
[{:keys [state]} key params] | |
(let [st @state] | |
{:value (get-in-link st (get st key))})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment