How to use component-bind - 10 common examples

To help you get started, we’ve selected a few component-bind examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github weapp-socketio / wxapp-socket-io / src / manager.js View on Github external
Manager.prototype.onopen = function() {
  this.cleanup()

  this.readyState = 'open'
  this.emit('open')

  const socket = this.engine
  this.subs.push(on(socket, 'data', bind(this, 'ondata')))
  this.subs.push(on(socket, 'ping', bind(this, 'onping')))
  this.subs.push(on(socket, 'pong', bind(this, 'onpong')))
  this.subs.push(on(socket, 'error', bind(this, 'onerror')))
  this.subs.push(on(socket, 'close', bind(this, 'onclose')))
  // this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')))
}
github weapp-socketio / wxapp-socket-io / src / manager.js View on Github external
Manager.prototype.onopen = function() {
  this.cleanup()

  this.readyState = 'open'
  this.emit('open')

  const socket = this.engine
  this.subs.push(on(socket, 'data', bind(this, 'ondata')))
  this.subs.push(on(socket, 'ping', bind(this, 'onping')))
  this.subs.push(on(socket, 'pong', bind(this, 'onpong')))
  this.subs.push(on(socket, 'error', bind(this, 'onerror')))
  this.subs.push(on(socket, 'close', bind(this, 'onclose')))
  // this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')))
}
github weapp-socketio / wxapp-socket-io / src / manager.js View on Github external
Manager.prototype.onopen = function() {
  this.cleanup()

  this.readyState = 'open'
  this.emit('open')

  const socket = this.engine
  this.subs.push(on(socket, 'data', bind(this, 'ondata')))
  this.subs.push(on(socket, 'ping', bind(this, 'onping')))
  this.subs.push(on(socket, 'pong', bind(this, 'onpong')))
  this.subs.push(on(socket, 'error', bind(this, 'onerror')))
  this.subs.push(on(socket, 'close', bind(this, 'onclose')))
  // this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')))
}
github weapp-socketio / wxapp-socket-io / src / manager.js View on Github external
Manager.prototype.onopen = function() {
  this.cleanup()

  this.readyState = 'open'
  this.emit('open')

  const socket = this.engine
  this.subs.push(on(socket, 'data', bind(this, 'ondata')))
  this.subs.push(on(socket, 'ping', bind(this, 'onping')))
  this.subs.push(on(socket, 'pong', bind(this, 'onpong')))
  this.subs.push(on(socket, 'error', bind(this, 'onerror')))
  this.subs.push(on(socket, 'close', bind(this, 'onclose')))
  // this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')))
}
github weapp-socketio / wxapp-socket-io / src / socket.js View on Github external
Socket.prototype.subEvents = function() {
  if (this.subs) return

  const io = this.io
  this.subs = [
    on(io, 'open', bind(this, 'onopen')),
    on(io, 'packet', bind(this, 'onpacket')),
    on(io, 'close', bind(this, 'onclose')),
  ]
}
github weapp-socketio / wxapp-socket-io / src / engine.js View on Github external
Engine.prototype.bindEvents = function() {
  this.subs.push(on(GlobalEmitter, 'open', bind(this, 'onopen')))
  this.subs.push(on(GlobalEmitter, 'close', bind(this, 'onclose')))
  this.subs.push(on(GlobalEmitter, 'error', bind(this, 'onerror')))
  this.subs.push(on(GlobalEmitter, 'packet', bind(this, 'onpacket')))
}
github weapp-socketio / wxapp-socket-io / src / socket.js View on Github external
Socket.prototype.subEvents = function() {
  if (this.subs) return

  const io = this.io
  this.subs = [
    on(io, 'open', bind(this, 'onopen')),
    on(io, 'packet', bind(this, 'onpacket')),
    on(io, 'close', bind(this, 'onclose')),
  ]
}
github weapp-socketio / wxapp-socket-io / src / engine.js View on Github external
Engine.prototype.bindEvents = function() {
  this.subs.push(on(GlobalEmitter, 'open', bind(this, 'onopen')))
  this.subs.push(on(GlobalEmitter, 'close', bind(this, 'onclose')))
  this.subs.push(on(GlobalEmitter, 'error', bind(this, 'onerror')))
  this.subs.push(on(GlobalEmitter, 'packet', bind(this, 'onpacket')))
}
github weapp-socketio / wxapp-socket-io / src / socket.js View on Github external
Socket.prototype.subEvents = function() {
  if (this.subs) return

  const io = this.io
  this.subs = [
    on(io, 'open', bind(this, 'onopen')),
    on(io, 'packet', bind(this, 'onpacket')),
    on(io, 'close', bind(this, 'onclose')),
  ]
}
github weapp-socketio / wxapp-socket-io / src / engine.js View on Github external
Engine.prototype.bindEvents = function() {
  this.subs.push(on(GlobalEmitter, 'open', bind(this, 'onopen')))
  this.subs.push(on(GlobalEmitter, 'close', bind(this, 'onclose')))
  this.subs.push(on(GlobalEmitter, 'error', bind(this, 'onerror')))
  this.subs.push(on(GlobalEmitter, 'packet', bind(this, 'onpacket')))
}

component-bind

function binding utility

MIT
Latest version published 10 years ago

Package Health Score

65 / 100
Full package analysis

Popular component-bind functions