function drawBezier(ctx, origin_nodes) { if(t > 1) { isPrinting = false return } isPrinting = true var nodes = origin_nodes t += 0.01 ctx.clearRect(0, 0, canvas.width, canvas.height) drawnode(nodes) window.requestAnimationFrame(drawBezier.bind(this, ctx, nodes)) }
this.consumer.once('ready', function() { // This is the way Node.js does it // https://github.com/nodejs/node/blob/master/lib/fs.js#L1733 this._read(size); }.bind(this));
/** * @description Initialiaze service with dependencies and connect to devices. * @example * connect(); */ function connect() { // Loads MQTT service this.mqttService = this.gladys.service.getService('mqtt'); // Subscribe to Tasmota topics this.mqttService.device.subscribe('stat/+/+', this.handleMqttMessage.bind(this)); this.mqttService.device.subscribe('tele/+/+', this.handleMqttMessage.bind(this)); }
/** * @description Add node * @example * zwave.removeNode(); */ function removeNode() { logger.debug(`Zwave : Entering exclusion mode`); this.zwave.removeNode(); setTimeout(this.cancelControllerCommand.bind(this), REMOVE_NODE_TIMEOUT); }
constructor() { super(); this.tooltipRef = null; METHODS_TO_BIND.forEach(method => { this[method] = this[method].bind(this); }); }
fetchCurrentTransferSummary() { if (this.pollTimeout != null) { clearTimeout(this.pollTimeout); } this.services.clientGatewayService .fetchTransferSummary(transferSummaryMethodCallConfig) .then(this.handleFetchTransferSummarySuccess.bind(this)) .catch(this.handleFetchTransferSummaryError.bind(this)); }
constructor(...serviceConfig) { super(...serviceConfig); this.count = Object.assign({}, INITIAL_COUNT_VALUE); this.ready = false; this.db = this.loadDatabase(); this.emitUpdate = _.debounce(this.emitUpdate.bind(this), 100); this.countNotifications(); }
initReader() { this.reader.on('items', this.handleFeedItems.bind(this)); this.reader.on('error', error => { console.log('Feed reader error:', error); }); this.reader.start(); }
/** * @description Listen. * @example * xiaomi.listen(); */ function listen() { this.socket = this.dgram.createSocket({ type: 'udp4', reuseAddr: true }); this.socket.on('listening', eventFunctionWrapper(this.listening.bind(this))); this.socket.on('message', eventFunctionWrapper(this.onMessage.bind(this))); // this.socket.on('data.weather', this.addTemperatureSensor.bind(this)); this.socket.bind(SERVER_PORT); }
constructor(session) { this.session = session; this.session.dispatcher.addListener('GLADYS_GATEWAY_CONNECTED', this.emptyQueue.bind(this)); this.queue = []; }
constructor(props) { super(props); this.sortableListRef = null; this.state = { listOffset: null, items: props.items, }; methodsToBind.forEach(method => { this[method] = this[method].bind(this); }); }
constructor(props) { super(props); this.state = { loading: true }; this.selectFeature = this.selectFeature.bind(this); this.addFeature = this.addFeature.bind(this); this.deleteFeature = this.deleteFeature.bind(this); this.updateDeviceProperty = this.updateDeviceProperty.bind(this); this.updateFeatureProperty = this.updateFeatureProperty.bind(this); this.saveDevice = this.saveDevice.bind(this); }
constructor() { super(); METHODS_TO_BIND.forEach(method => { this[method] = this[method].bind(this); }); }
constructor() { super(); this.focusedCell = null; this.focusedCellWidth = null; this.isMouseDown = false; this.lastMouseX = null; methodsToBind.forEach(method => { this[method] = this[method].bind(this); }); }
constructor(props) { super(props); this.state = { loading: true }; this.selectFeature = this.selectFeature.bind(this); this.addFeature = this.addFeature.bind(this); this.deleteFeature = this.deleteFeature.bind(this); this.updateDeviceProperty = this.updateDeviceProperty.bind(this); this.updateFeatureProperty = this.updateFeatureProperty.bind(this); this.saveDevice = this.saveDevice.bind(this); }