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
| (try | |
| (d/catch (d/chain (throw (ex-info "standard failure" {:type :foo}))) | |
| (fn [e] | |
| (println "d/catch e" (.getMessage e)))) | |
| (catch Exception e | |
| (println "try/catch e" (.getMessage e)))) | |
| (try | |
| (d/catch (d/chain (d/error-deferred (ex-info "deferred error" {:type :bar}))) | |
| (fn [e] |
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
| (ns example.errors) | |
| (defn clean-address [params] | |
| "Ensure (params :address) is present" | |
| (if (empty? (params :address)) | |
| [nil "Please enter your address"] | |
| [params nil])) | |
| (defn clean-email [params] | |
| "Ensure (params :email) matches *@*.*" |
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 task-list [] | |
| (let [visible-todos @(subscribe [:visible-todos]) | |
| all-complete? @(subscribe [:all-complete?])] | |
| [:section#main | |
| [:input#toggle-all | |
| {:type "checkbox" | |
| :checked all-complete? | |
| :on-change #(dispatch [:complete-all-toggle])}] | |
| [:label | |
| {:for "toggle-all"} |
OlderNewer