chrome.extension.onConnect.addListener(function(port) { var portId = maxPortId++; mapPorts[portId] = port; var tabId = port.sender.tab.id; port.onMessage.addListener(function(msg){ sendGlobalEvents(msg, tabId); }); port.onDisconnect.addListener(function(port){ delete mapPorts[portId]; }); });
componentDidMount() { this.props.getDevicesInRoom(this.props.box, this.props.x, this.props.y); this.props.session.dispatcher.addListener( WEBSOCKET_MESSAGE_TYPES.DEVICE.NEW_STATE, this.updateDeviceStateWebsocket ); }
function MutantPullDict (listener) { if (!listener) { return this.binder.getValue() } return this.binder.addListener(listener) }
function startStaticServer(port) { const fileServer = new statics.Server(`${__dirname}/data`); http.Server((req, res) => { req.addListener('end', () => { fileServer.serve(req, res); }).resume(); }).listen(port); }
componentWillMount() { this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY, this.nodeReadyListener); this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.ZWAVE.SCAN_COMPLETE, this.scanCompleteListener); this.props.getIntegrationByName('zwave'); this.props.getNodes(); this.props.getStatus(); }
// catch incognito window chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { if (!tab.incognito && isWorking && /^chrome:\/\//.test(tab.url) === false) { var windowId = getWindowId(tabId); if(windowId === -1){ windowId = addWindowId(tabId); } } });
componentDidMount() { this.props.getUsersWithPresence(); this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.USER_PRESENCE.BACK_HOME, payload => this.props.userChanged(payload) ); this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.USER_PRESENCE.LEFT_HOME, payload => this.props.userChanged(payload) ); }
browser_.runtime.onInstalled.addListener(function() { if (window.joplinEnv() === 'dev') { browser_.browserAction.setIcon({ path: 'icons/32-dev.png', }); } });
async componentWillMount() { this.props.getDiscoveredTasmotaDevices(); this.props.getHouses(); this.props.getIntegrationByName('tasmota'); this.props.session.dispatcher.addListener( WEBSOCKET_MESSAGE_TYPES.TASMOTA.NEW_DEVICE, this.props.addDiscoveredDevice ); }
constructor(session) { this.session = session; this.session.dispatcher.addListener('GLADYS_GATEWAY_CONNECTED', this.emptyQueue.bind(this)); this.queue = []; }
componentWillMount() { this.props.getHouses(); this.props.getXiaomiSensors(); this.props.getXiaomiDevices(); this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.XIAOMI.NEW_DEVICE, payload => { this.props.getXiaomiSensors(); }); }
async componentWillMount() { this.props.getDiscoveredTasmotaDevices(); this.props.getHouses(); this.props.getIntegrationByName('tasmota'); this.props.session.dispatcher.addListener( WEBSOCKET_MESSAGE_TYPES.TASMOTA.NEW_DEVICE, this.props.addDiscoveredDevice ); }
componentWillMount() { this.props.getHouses(); this.props.getXiaomiSensors(); this.props.getXiaomiDevices(); this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.XIAOMI.NEW_DEVICE, payload => { this.props.getXiaomiSensors(); }); }
componentWillMount() { this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.ZWAVE.NODE_READY, this.nodeReadyListener); this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.ZWAVE.SCAN_COMPLETE, this.scanCompleteListener); this.props.getIntegrationByName('zwave'); this.props.getNodes(); this.props.getStatus(); }
function MutantPullValue (listener) { if (!listener) { return this.binder.getValue() } return this.binder.addListener(listener) }