Fork me on GitHub
#re-frame
<
2020-04-28
>
Spaceman13:04:36

how do you dispatch an action as soon as the component has loaded, i.e., onComponentMount?

Spaceman13:04:06

say I want to (dispatch [:trigger-event]) when [:div.my-div "Foo"] has loaded in the dom

dominicm13:04:45

I think official recommendation is that you don't do this. Instead you should trigger the dispatch in response to the user event which brought them to this page (e.g. your router changing url, or the user clicking a button)

☝️ 8