Report leaky views in browser console.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
spec
.gitignore
.jsbeautifyrc
.jshintignore
.jshintrc
Backbone.LeakChecker.js
Backbone.LeakChecker.js.map
Backbone.LeakChecker.min.js
Gruntfile.js
LICENSE
README.md
bower.json
component.json
package.json

README.md

Backbone.LeakChecker

Report leaky views in browser console.

Installation

npm

npm install backbone.leakchecker --save

bower

bower install backbone.leakchecker --save

component

Insert the following to the dependencies section of your component.json

"aq1018/backbone.leakchecker": ">= 0.1.2"

Usage

require.js

// app.js
define('Backbone', 'backbone.leakchecker', function(Backbone, initLeakChecker) {
  // make sure this is run before everything else.
  initLeakChecker();

  // your Application class goes here
  function App(){

  }

  return new App();
});

browserify

// app.js

// make sure this is run before everything else.
require('backbone.leakchecker')();

// your Application class goes here
function App(){

}

module.exports = new App();

script tag

<!-- dependencies -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="underscore.js"></script>
<script type="text/javascript" src="backbone.js"></script>

<!-- this lib -->
<script type="text/javascript" src="backbone.leakchecker.js"></script>

<script type="text/javascript">
  // do this first
  initLeakChecker();
</script>

<!-- include your app here -->
<script type="text/javascript" src="app.js"></script>