New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subscribers aren't triggered when subscriptions are reloaded via figwheel #60
Comments
I might need a bit more information. Does this reloading involve figwheel? If it does, what are doing in your |
BTW, both re-frame examples now better demo a figwheel workflow. But that cleanup is only in the develop branch for the moment. |
Indeed. I had this, which may be old config:
|
I still don't know what Please have a careful look at the various examples. Like this one: Notice how I'm going to close this, because it is not really not a re-frame issue. |
Ah, sorry, I thought that was from a re-frame template. My (defn mount-root
[]
(reagent/render [my.views/my-app] (.getElementById js/document "app"))) So yes, it rerenders the entire page, at least in theory. In practice, it doesn't even call my.views/my-app, likely because its result is cached. Note that everything works properly if the |
After digging in though, you're right, it's not a reframe issue. I thought it had to do w/ the subscriptions, but it actually has to do w/ reagent/render doing its job. I'll check w/ reagent to see if there's a way to blow the cache. |
For posterity, I tossed |
It is puzzling that was needed. As I understand it, you are modifying a subscription handler, right, so that subs.cljs file will be reloaded, and then |
So here's the real fix: (defn mount-root
[]
(reagent/render [#'my.views/my-app] (.getElementById js/document "app"))) Note the |
Again, I'm puzzled as to why that would be a real fix. You aren't calling For further background: |
Here's a repro. You can ignore the piggieback stuff, just check the links. I'm guessing the problem has to do with memoized ratoms, but i haven't dug too deep. |
I ran into the issue with shadow-cljs, and while googling the solution I found this issue. Then I found P.S. See also Why clear sub cache note. |
@vganshin I also would suggest creating an app using |
If I make a change to a sub, I have to reload the page or otherwise change the state in order for the sub to get triggered. Ideally, the subs should fire if they're reloaded.
The text was updated successfully, but these errors were encountered: