fixed, get would fail when key doesn't exist
This commit is contained in:
parent
95d0f566d7
commit
83ab6ad3ef
|
@ -55,7 +55,7 @@
|
|||
(-> (aget result 0)))
|
||||
|
||||
(defn single-cljs [result]
|
||||
(-> (aget result 0)
|
||||
(some-> (aget result 0)
|
||||
(js->clj :keywordize-keys true)))
|
||||
|
||||
(defn decode-value [{:keys [key value]}]
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
(r/create :kv-store {:key key
|
||||
:value (str value)} true))))
|
||||
(get [_ key]
|
||||
(-> (r/get-by-field :kv-store :key key)
|
||||
(some-> (r/get-by-field :kv-store :key key)
|
||||
(r/single-cljs)
|
||||
(r/decode-value)))
|
||||
(contains-key? [_ key]
|
||||
|
|
Loading…
Reference in New Issue