Permalink
Browse files

use :receive not :change

  • Loading branch information...
1 parent 1cc50a7 commit 34187f0efdf966da28203ff982a559765cfa7bdc @timruffles timruffles committed Mar 28, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 README.md
View
@@ -35,10 +35,10 @@ Since pages will change without a full reload with Turbolinks, you can't by defa
* `page:change` page has changed to the newly fetched version.
* `page:receive` page has been fetched from the server, but not yet parsed.
-So if you wanted to have a client-side spinner, you could listen for `page:fetch` to start it and `page:change` to stop it.
+So if you wanted to have a client-side spinner, you could listen for `page:fetch` to start it and `page:receive` to stop it.
document.addEventListener("page:fetch", startSpinner);
- document.addEventListener("page:change", stopSpinner);
+ document.addEventListener("page:receive", stopSpinner);
If you have DOM transformation that are not idempotent (the best way), you can hook them to happen only on `page:load` instead of `page:change` (as that would run them again on the cached pages).

0 comments on commit 34187f0

Please sign in to comment.