Skip to content

Instantly share code, notes, and snippets.

@squeedee
Created November 11, 2015 15:41
Show Gist options
  • Save squeedee/9985567a64dc42627589 to your computer and use it in GitHub Desktop.
Save squeedee/9985567a64dc42627589 to your computer and use it in GitHub Desktop.
Rash learns update-in
(update-in {:editor {:name "foo"}} [:editor] (fn [a b] (str a b)) 1)
;{:editor "{:name \"foo\"}1"}
(update-in {:editor {:name "foo"}} [:editor] (fn [a b] (str (:name a) b)) 1)
;{:editor "foo1"}
(update-in {:editor {:name "foo"}} [:editor :name] (fn [a b] (str a b)) 1)
;{:editor {:name "foo1"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment