MCPcopy Index your code
hub / github.com/shipshapecode/tether / on

Method on

src/js/evented.js:4–14  ·  view source on GitHub ↗
(event, handler, ctx, once = false)

Source from the content-addressed store, hash-verified

2
3export class Evented {
4 on(event, handler, ctx, once = false) {
5 if (isUndefined(this.bindings)) {
6 this.bindings = {};
7 }
8 if (isUndefined(this.bindings[event])) {
9 this.bindings[event] = [];
10 }
11 this.bindings[event].push({ handler, ctx, once });
12
13 return this;
14 }
15
16 once(event, handler, ctx) {
17 return this.on(event, handler, ctx, true);

Callers 4

onceMethod · 0.95
evented.spec.jsFile · 0.80
intro.jsFile · 0.80
jquery.jsFile · 0.80

Calls 1

isUndefinedFunction · 0.90

Tested by

no test coverage detected