Created
January 15, 2017 01:38
-
-
Save lgessler/c7654f775e670effebd657af9a6f42f2 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
| ;; not modularized but is DRY as far as subs go | |
| (defn top [] | |
| (fn [] | |
| (let [foo (sub [:foo]) | |
| bar (sub [:bar])] | |
| [:div | |
| [:span (str @foo @bar)] | |
| [:span @foo]]))) | |
| ;; modularized but you have to repeat subs | |
| (defn sub1 [] (fn [] [:span (str @(sub [:foo]) @(sub [:bar]))])) | |
| (defn sub2 [] (fn [] [:span (str @(sub [:foo]))])) | |
| (defn top [] (fn [] [:div sub1 sub2])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment