reagent-project / reagent-template

A Leiningen template for projects using Reagent.
MIT License
394 stars 55 forks source link

force-update-all needed to re-render after changing non-core ns #4

Closed noklesta closed 9 years ago

noklesta commented 10 years ago

If you change a component in a namespace other than core, it won't be re-rendered by the call to core/init! in the jsload-callback in dev/cljs/reagent/dev.cljs. In order to make re-rendering work, I had to replace it by a call to force-update-all.

I would create a pull request, but since force-update-all was introduced in holmsand/reagent@ba995c2e0dc93e8cdad70107c2847294cce2c7fd and reagent-template uses reagent v0.4.2, it won't work until a more recent version of reagent is used. In any case, I am not sure if it is the best approach, but at least it works.

yogthos commented 10 years ago

I'd keep the issue open until new reagent gets released from the org with the latest features. Is there any obvious downsides to using force-update-all?

noklesta commented 10 years ago

I'm new to reagent and don't really know the code, so I cannot tell for sure. But at least it only applies in dev mode anyway. The commit message says it was introduced to ease integration with LightTable, so it seems to be meant for use in tooling.

yogthos commented 10 years ago

Since it would only be invoked in dev mode, it sounds like it might be the right approach here. I'm assuming LT has the same issue as the template.

Frozenlock commented 9 years ago

Fixed in the new version (0.2.2).