fix: remove dedupe-by since it doesn't allow consecutive writes

This commit is contained in:
Tienson Qin
2023-11-22 17:55:59 +08:00
parent 85a0f32e05
commit 281ae72619
2 changed files with 1 additions and 20 deletions

View File

@@ -31,10 +31,7 @@
:today nil
:system/events (async/chan 1000)
:db/batch-txs (async/chan 1000)
:file/writes (async/chan 10000
(util/dedupe-by
(fn [[repo page-id outliner-op _epoch]]
[repo page-id outliner-op])))
:file/writes (async/chan 10000)
:file/unlinked-dirs #{}
:reactive/custom-queries (async/chan 1000)
:notification/show? false

View File

@@ -1513,19 +1513,3 @@ Arg *stop: atom, reset to true to stop the loop"
(if (satisfies? IMeta o)
(with-meta o meta)
o)))
(defn dedupe-by
([keyfn]
(fn [rf]
(let [pa (volatile! ::none)]
(fn
([] (rf))
([result] (rf result))
([result input]
(let [prior @pa
key (keyfn input)]
(vreset! pa key)
(if (= prior key)
result
(rf result input)))))))))