r/Clojure • u/f_of_g_of_x • Nov 15 '19
reagent doesn't reinitialize my r/atoms when a subscription triggers a change
/r/Clojurescript/comments/dwgryk/reagent_doesnt_reinitialize_my_ratoms_when_a/
10
Upvotes
3
u/Beware_The_Leopard Nov 15 '19
Hey, i left this on your r/clojurescript post but I’ll leave it here too in case it’s helpful to anyone else. You can deref re-frame subscriptions from within simple form-1 style components as of 0.9.0, here’s is the dev discussion on GitHub : https://github.com/Day8/re-frame/issues/218#issuecomment-254718776
2
u/[deleted] Nov 15 '19 edited Nov 15 '19
Having not played with any of these tools before I started screwing around.
It looks like you want to repopulate the contact-editor-form when :editing-contact changes.
this got that behaviour working for me:
Unfortunately, I couldn't tell you why returning a function seems to break the scope of the atom like that.
Edit:
If you want the textboxes to actually work, you need the atoms to change when the
:editing-contactchanges