Skip to content

Commit 3847666

Browse files
committed
clarify lookup-or-miss usage
1 parent 442652a commit 3847666

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,12 @@ The expectation is that you use _either_ `clojure.core.cache` _or_
144144

145145
;=> 1
146146

147-
;; unique to the wrapped API:
147+
;; unique to the wrapped API, this combines through-cache and lookup
148+
;; to return the looked up value, possibly after calling the passed in
149+
;; function with the key to populate the cache if the key wasn't present:
148150
(w/lookup-or-miss C3 :b (constantly 42))
151+
;; calls (jdbc/get-by-id :storage my-key) in the event of a cache miss:
152+
(w/lookup-or-miss C3 my-key (partial jdbc/get-by-id db-spec :storage))
149153

150154
;=> 42
151155

0 commit comments

Comments
 (0)