Fork me on GitHub

I’m having a problem where I’m using comp/transact!! on fields in a sub-form modal. My sub-form changes into dirty state and the UI updates accordingly, but the parent isn’t seeing the changes, so when I trigger “save” on the parent form from the sub-form’s modal, the changes don’t propagate to the back-end because fs/dirty-fields at the parent returns nothing.


The problem was from calling fs/mark-complete* from within the comp/transact!!. I instead made a second comp/transact! that just calls fs/mark-complete! and that seems to fix it.


anyone doing backend pagination? with datomic? i was doing front end pagination ( get full list of items and paginate on those ) but too many to handle now. with datomic i found the limit and offset and not deterministic, so do i have to get all items in query and sort and limit and offset manually ?


@dansudol that’s how I’m doing it. One possible improvement I haven’t tried is only getting the db IDs (and minimum sort keys), paginate those, then only retrieve the entity bodies for the current page of ids


gotcha thosmos, that is another idea too


(defn limit-fn
  "Collection pagination mimicking the MySql LIMIT"
  ([quantity coll]
   (limit-fn quantity 0 coll))
  ([quantity start-from coll]
   (let [quantity   (or quantity 20)
         start-from (or start-from 0)]
     (take quantity (drop start-from coll)))))


Also d/qseq returns a lazy collection that’s useful if you don’t need to sort before paging