Last active
December 8, 2020 19:28
-
-
Save williammustaffa/ae93a0765ef5766dca2077c105c8196a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pubsub from 'pubsub'; | |
import spinner from 'spinner'; | |
import ccLogger from 'ccLogger'; | |
export default { | |
onLoad() { | |
const occDebugger = this._occDebugger; | |
occDebugger.debug('spinner'); | |
occDebugger.debug('topics'); | |
}, | |
debug(featureName) { | |
switch(featureName) { | |
case 'spinner': | |
const _buildCSS = spinner.buildCSS; | |
const _destroyWithoutDelay = spinner.destroyWithoutDelay; | |
spinner.buildCSS = function () { | |
console.warn(`[OCC-DEBUGGER][Spinner created]`, arguments); | |
_buildCSS.apply(this, arguments); | |
} | |
spinner.destroyWithoutDelay = function () { | |
console.warn(`[OCC-DEBUGGER][Spinner destroyed]`, arguments); | |
_destroyWithoutDelay.apply(this, arguments); | |
} | |
break; | |
case 'topics': | |
Object.keys(pubsub.topicNames).map(topicName => { | |
$.Topic(pubsub.topicNames[topicName]).subscribe((...args) => { | |
console.warn(`[OCC-DEBUGGER][Topic triggered]${topicName}:`, ...args); | |
}); | |
}); | |
break; | |
default: | |
ccLogger.warn('[OCC-DEBUGGER] Feature not supported.') | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment