How to use the bind-deep function in bind-deep

To help you get started, we’ve selected a few bind-deep 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 rocketryjs / rocketry / src / device.ts View on Github external
constructor(input, output, portNums) {
		// EventEmitter
		super();

		// Properties
		if (!input || !output || !portNums) {
			throw new Error("Missing argument when creating a new device.");
		}
		this.input = input;
		this.output = output;
		this.portNums = portNums;

		this.send = bindDeep(this, send);

		// Call the initializers defined on the subclass (e.x. from mixins)
		this.constructor.inits.forEach(init => init.call(this));

		// Open connection with device
		this.open();
	}

bind-deep

Lightweight module for binding a function or object deeply.

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular bind-deep functions