Fork me on GitHub
#fulcro
<
2022-03-29
>
tony.kay00:03:30

* is supported EQL

đź‘Ť 1
aratare05:03:14

Hi there. I'm using form state at the moment and I notice that when an entity is removed, its form state remains inside ::fs/forms-by-ident. Is there any helpers I can use to remove all form-stuff when its entity is removed? Thanks in advance.

aratare05:03:36

One thing I can think of is to use ::fs/config within the entity and dissoc it from ::fs/forms-by-ident. I think this is the way to do it but not so sure.

tony.kay14:03:57

GC is not automatic, because there is no way for Fulcro to reliably know when something isn’t still in use. So yes, if you are wanting to be particular about such a thing, you can dissoc it yourself. See https://cljdoc.org/d/com.fulcrologic/fulcro/3.4.3/api/com.fulcrologic.fulcro.algorithms.normalized-state

tony.kay14:03:12

it has helpers for scanning and removing things, like remove-entity

aratare15:03:24

@U0CKQ19AQ Wonderful! remove-entity is exactly what I need 🙂 Thank you very much!

roklenarcic14:03:02

Fulcro switched from UUIDv4 to UUIDv1?

tony.kay14:03:11

You mean tempids and new-uuid in RAD? Using https://github.com/yetanalytics/colossal-squuid now because of recommendations in databases.

tony.kay14:03:42

(including Datomic…and yes I know they say you can get away without them, but they still actually recommend them for values you index and use as IDs, or that correlate with usage over time)

roklenarcic08:03:36

Interesting, but aren’t these based on a MAC address/host + timestamp + a small random value? Does that make the chance of collision rather high if same host generates a lot of UUIDs at the same time?

tony.kay16:03:49

My understanding of their implementation is that there is a random component (upper bits are time), and a local increment counter for uuids generated on the same machine. So, changes of collision should be pretty small. It’s why I chose this lib instead of uuidv1, which generated things that look way more likely to cause collision for my comfort.