Refactor structure to be more testable

This commit is contained in:
Keegan
2016-01-27 00:03:07 -08:00
parent b960dc19f4
commit 13b84f7e6c
19 changed files with 391 additions and 3095 deletions
+9 -9
View File
@@ -1,15 +1,15 @@
'use strict';
module.exports = function() {
var Api = window.Clay = this;
var Clay = this;
var testHandler = function() {
console.debug('KEEGAN: this', this);
console.debug('KEEGAN: arguments', arguments);
// Api.getItemByAppKey('background').off(testHandler);
};
Clay.getItemByAppKey('cool_stuff').on('change', function() {
if (this.get()) {
Clay.getItemByAppKey('background').enable();
} else {
Clay.getItemByAppKey('background').disable();
}
});
Api.getItemByAppKey('background').on('change', testHandler);
console.debug('custom fn worked');
Clay.getSettings();
};