reagent-project / reagent-template

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

Use (core/init!) instead of (force-update-all) for Figwheel reload #36

Closed schmee closed 9 years ago

schmee commented 9 years ago

I spent a couple of hours trying to get Figwheel to work with my app, which didn't auto-reload even though everything looked just fine in the Figwheel logs and in the dev console. Then I stumbled upon https://github.com/reagent-project/reagent/issues/94. Replacing (r/force-update-all) with (core/init!) in https://github.com/reagent-project/reagent-template/blob/master/src/leiningen/new/reagent/env/dev/cljs/reagent/dev.cljs#L11 solved my problem.

Since force-update-all doesn't re-render the root component and core/init! does, it seems to me that the latter is a safer default.

yogthos commented 9 years ago

The only issue there is that core/init! runs some initialization code as well such as hooking in browser navigation that should only be run once on page load.