Skip to content

Instantly share code, notes, and snippets.

@jamhed
Created March 30, 2015 18:06
Show Gist options
  • Save jamhed/60afd9a291e6599fc181 to your computer and use it in GitHub Desktop.
Save jamhed/60afd9a291e6599fc181 to your computer and use it in GitHub Desktop.
auto-reload
setup_sync() ->
sync:go(),
{ok, Comet} = wf:comet(fun() -> reload() end),
sync:onsync(fun(_) -> Comet ! {self(), reload} end).
reload() ->
receive
{_, reload} ->
wf:wire( "location.reload()" ),
wf:flush()
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment