Fork me on GitHub
#fulcro
<
2018-08-11
>
currentoor00:08:18

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

currentoor00:08:13

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?

claudiu07:08:21

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

claudiu07:08:20

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

tony.kay16:08:55

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.

tony.kay16:08:51

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)

tony.kay16:08:36

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.

wilkerlucio13:08:22

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

priornix04:08:16

Hi, author of https://github.com/priornix/antizer here. How many guys are interested in a Fulcro port of Antizer?

tony.kay06:08:53

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