Fork me on GitHub

@chris.schreiner i don’t think there’s any better way to do it, i’m also doing something similar


but generating a sequence of :db/add :db/retract tuples based on the form state diff seems very straightforward no?

Chris Swanson01:08:38

@currentoor right on, thanks. yea it's pretty simple, i was just curious

Chris Swanson02:08:49

i know this is more a clojure thing, but what do you all do about circular dependencies? I'm finding it hard to organize my fulcro app in a natural way. Like I have some file with component definitions, and another file with mutations. The components need to require mutations to trigger them. But then I often need to reference a component in a mutation (for example to add-form-config). Do you just leave all related components and mutations in the same file?


Think requiering mutations to trigger them is just for "convenience". You can just do transact and add the full namespaced name there.


For muations think you have the component that triggered the mutation in the env.


I have also been known to make an atom (e.g. in the mutation namespace), and then reset it to the component class at the component declaration. The component can then use aliases from the ns decl, and the mutation can just deref the atom to get the class.


You could also put your component classes in some kind of central registry (same technique…e.g. make a global map at some leaf of the ns graph that is keyed by symbol)


but as @U3LP7DWPR says: mutation calling is just data. The aliasing is convenient…so if you don’t want a registry kind of thing, just fully-qualify your mutation calls.


a simple option is keeping then at the same file, I found that having mutations closer to call site is often convenient

Chris Swanson02:08:03

Guess I shouldn't say "often" - looking more closely, that's actually the only legitimate cause of dependency cycle. i was able to refactor everything else into a clean dep tree, but the add-form-config / component thing is still an issue for me


Hi, author of here. How many guys are interested in a Fulcro port of Antizer?


2.6.0-RC6 is on clojars. This completes the React 16+ port. Still undergoing testing, but it is looking pretty solid so far.

🙂 12