warn-when-not-reactive: funcall vs. component use #766
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes when I write hiccup, I write (component) instead of [component] which leads to the error message from #752 if component tries to subscribe to something.
The warning as it is now talks about subscribing from event handlers or from javascript events. I found this confusing because I was pretty certain I had not touched any event handlers. But it also said "not in a reactive context" which got me on the right track.
I would argue that this is an even more likely cause for that warning and should be mentionend, especially since this is the more likely error for people new to reagent and/or re-frame. There was no other output besides this warning, just a silently malfunctioning program.
I do not care about the exact wording, but I think there should be mention of function calls vs use of a component.
I am aware of #754 and that it wants to remove the warning again. I would argue that instead of the new
(when (reactive?))
there should be anif
where the else branch mentions function calls vs components. I am pretty certain it does not fix this case - it just moves the check forreactive?
into the function that is called from the old check location.