MCPcopy
hub / github.com/dropzone/dropzone / on

Method on

src/emitter.js:7–15  ·  view source on GitHub ↗
(event, fn)

Source from the content-addressed store, hash-verified

5export default class Emitter {
6 // Add an event listener for given event
7 on(event, fn) {
8 this._callbacks = this._callbacks || {};
9 // Create namespace for this event
10 if (!this._callbacks[event]) {
11 this._callbacks[event] = [];
12 }
13 this._callbacks[event].push(fn);
14 return this;
15 }
16
17 emit(event, ...args) {
18 this._callbacks = this._callbacks || {};

Callers 2

test.jsFile · 0.80
initMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected