Fork me on GitHub
#biff
<
2022-10-16
>
macrobartfast04:10:02

I call

(defn delete [req]
  (db/delete-frog req)
  (frog-results (db/frogs)))
where frog-results will be a list of treefrogs fetched from the database. However, frog-results (which is the HTML to be returned and swapped) includes the frog that was to be eliminated. So, in another language I’d probably put in an awkward thread sleep statement.

Jacob O'Bryant04:10:26

biff/submit-tx will block until the transaction is indexed. (if you use xt/submit-tx, then you can call xt/await-tx, which is what biff/submit-tx does). after that, you need to get a fresh db value, by E.g. by calling (xt/db node). you can also do (:biff/db (biff/assoc-db req)). in this case, I would change db/frogs so it takes the db as a parameter, then call (db/frogs (xt/db (:biff.xtdb/node req))).

😃 1