We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e33440 commit 4b1f15fCopy full SHA for 4b1f15f
src/datascript/storage.cljs
@@ -158,11 +158,13 @@
158
:max-eid max-eid
159
:max-tx max-tx})]
160
(remember-db db)
161
- [db (mapv #(keep (fn [[e a v tx added]]
+ [db (mapv #(keep (fn [[e a v tx]]
162
;; fix unique constraint
163
- (let [datom-exists? (some? (db/-datoms db :eavt e a v nil))]
164
- (when-not (and datom-exists? added)
165
- (db/datom e a v tx added)))) %)
+ (let [datom-exists? (some? (db/-datoms db :eavt e a v nil))
+ ;; retracted tx < 0
+ added? (> tx 0)]
166
+ (when-not (and datom-exists? added?)
167
+ (db/datom e a v tx)))) %)
168
tail)]))))
169
170
(defn db-with-tail [db tail]
0 commit comments