Fork me on GitHub
#re-frame
<
2019-09-21
>
jahson17:09:49

I don't know if the watcher will be destroyed, but you can use a finally for with-let http://reagent-project.github.io/docs/master/reagent.core.html#var-with-let

alekszelark12:09:54

Thank you, didn’t see it.

alekszelark12:09:57

I answered by myself.

Quest19:09:54

For those have used re-posh (https://github.com/denistakeda/re-posh), did you end up storing all of your app-state exclusively in Datascript or did you split it between re-frame's app-db & re-posh's app-db?

Quest19:09:51

I'm asking b/c some things seem awkward -- for instance, having a subscription to the current :modal. Datalog won't let you use nil values, so you must set :modal :none instead. For getting "update in place" on the modal entity, you'll need to pass an entity-id. Recall that datoms are tuples of [entity-id key value], so you either: A) hardcode UI to a specific entity-id to leverage datascript "upsertion" (overwrites prior entity keys) B) subscription query must filter to the chronological latest of all transacted :myapp/modal entities

henrik07:09:51

I’ve never used re-posh (thanks for highlighting it!), but if it’s like Datomic, I would probably create a modal entity and give it an ID as an attribute, then select it from the DB with that ID as a parameter to the query.

henrik07:09:43

I.e., based on the application-logic ID, get the Datomic-internal-plumbing-ID, then use that to target the Datom in the transaction.

👍 4