Skip to content

Instantly share code, notes, and snippets.

@mprokopov
Created April 2, 2021 15:29
Show Gist options
  • Save mprokopov/6e858a36bfabc30f5306b5ed11869b1a to your computer and use it in GitHub Desktop.
Save mprokopov/6e858a36bfabc30f5306b5ed11869b1a to your computer and use it in GitHub Desktop.
example of calling tap> function and return value. Useful when used with chain operators
(def get-account
(interceptor/handler
(fn [{db :db user-id :user/id}]
(let [pull-exp [::account/id
::account/balance
{::account/currency [::currency/name
::currency/minor-unit
::currency/description]}]]
(ok
(->
(account/find-user-accounts db [::user/id user-id])
(pulled db pull-exp)
(->> (map assoc-float-balance))
(doto tap>)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment