@webex/webex-core
Version:
Plugin handling for Cisco Webex
47 lines (41 loc) • 886 B
JavaScript
/*!
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
*/
import util from 'util';
import AmpState from 'ampersand-state';
/**
* WebexInternalCore is an extra layer of nesting to make it blatantly clear that
* private plugins are, in fact, private.
* @class
*/
const WebexInternalCore = AmpState.extend({
derived: {
ready: {
deps: [],
fn() {
return Object.keys(this._children).reduce(
(ready, name) => ready && this[name] && this[name].ready !== false,
true
);
},
},
},
/**
* @instance
* @memberof WebexPlugin
* @param {number} depth
* @private
* @returns {Object}
*/
inspect(depth) {
return util.inspect(
this.serialize({
props: true,
session: true,
derived: true,
}),
{depth}
);
},
});
export default WebexInternalCore;