backbone.leakchecker
v0.1.2
Published
Report leaky views in browser console.
Downloads
2
Readme
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>