Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/third_party/closure/goog/events/eventid.js
4575 views
1
/**
2
* @license
3
* Copyright The Closure Library Authors.
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
goog.provide('goog.events.EventId');
8
9
10
11
/**
12
* A templated class that is used when registering for events. Typical usage:
13
*
14
* /** @type {goog.events.EventId<MyEventObj>} *\
15
* var myEventId = new goog.events.EventId(
16
* goog.events.getUniqueId(('someEvent'));
17
*
18
* // No need to cast or declare here since the compiler knows the
19
* // correct type of 'evt' (MyEventObj).
20
* something.listen(myEventId, function(evt) {});
21
*
22
* @param {string} eventId
23
* @template T
24
* @constructor
25
* @struct
26
* @final
27
*/
28
goog.events.EventId = function(eventId) {
29
'use strict';
30
/** @const */ this.id = eventId;
31
};
32
33
34
/**
35
* @override
36
* @return {string}
37
*/
38
goog.events.EventId.prototype.toString = function() {
39
'use strict';
40
return this.id;
41
};
42
43