gazay/gon — pull request #166 by willcosgrove (2014-11-04 04:57:30+00:00)
Title: Added unwatchAll function to watch.js

### Use case

When using `gon.watch` and `turbolinks` together, your `gon.watch` callbacks will continue to fire even when you switch pages. With `gon.unwatchAll()` it becomes trivial to add an event handler to the page change event that clears all your watchers.

```coffeescript
$(document).on 'page:before-unload', ->
gon.unwatchAll()
```