How to use the tiny-emitter.mixin function in tiny-emitter

To help you get started, we’ve selected a few tiny-emitter 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 adobe / reactor-turbine / src / public / EventEmitter.js View on Github external
*
* NOTICE:  All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any.  The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property
* laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/

var assign = require('./assign');
var EventEmitter = require('tiny-emitter');

EventEmitter.mixin = function(obj) {
  assign(typeof obj === 'function' ? obj.prototype : obj, EventEmitter.prototype);
};

// Event emitter based on `tiny-emitter` library. It supports the following methods: `on`, `off`,
// `once`, `emit` and `mixin`. The `mixin` method can be used to add event emitter functionality to
// functions or existing instances.
module.exports = EventEmitter;

tiny-emitter

A tiny (less than 1k) event emitter library

MIT
Latest version published 5 years ago

Package Health Score

67 / 100
Full package analysis