is there a way to execute a callback every time figwheel successfully re-compiles?
@currentoor call it in a fn, say it is called my.app/on-js-reload
Then add :figwheel {:on-jsload "my.app/on-js-reload"}
to your relevant :cljsbuild
Assuming you are using Leiningen, lein-cljsbuild
, and figwheel
I believe that does what you are asking
@mikerod thanks for answering, but actually i meant on the back in the JVM
oh 😛
i want to hear a ting sound when it compiles successfully and a AANG sound when it fails to re-compile
like boot-reload
Maybe you can do it in your ring handler, if you are using one
:figwheel {:ring-handler my.app/fig-handler}
in your main :figwheel
config ?
and do the call in that handler fn
when does that ring handler get called by figwheel?
i thought that was to load assets?
Some reason I thought it was recalled on each server-reload
I definitely could be wrong
Nope, sorry
I’m being dumb
no worries 😄
You can put things in there that happen on each request
not on each reload
right
I wasn’t thinking straight
hmmm I can’t solve your issue then hah
Perhaps there is a way to tag onto the watchers of figwheel though
to be triggered similarly
yeah maybe i should look into that
I don’t know how to find out. Maybe somewhere in its wiki doc on GitHub
or just reading some figwheel source hah
You could maybe also do a big hack and havve your JS reload handler send a request to the server to tell it it reloaded
and you can have that do your callback hah
(except I guess that’d be JS reloads, and perhaps not the server-side ones you are looking for)
sounds good, thanks!