MCPcopy Create free account
hub / github.com/codecombat/codecombat / initialize

Method initialize

app/core/Tracker2/BaseTracker.js:94–112  ·  view source on GitHub ↗

* Standard initialization method to be used to initialize the tracker. Ensures that the * initialize process is only called once and returns the initializationComplete promise. * * Calls internal initialize method

()

Source from the content-addressed store, hash-verified

92 * Calls internal initialize method
93 */
94 async initialize () {
95 if (this.isInitializing) {
96 return this.initializationComplete
97 }
98
99 this.isInitializing = true
100
101 const initTimeout = new Promise((resolve, reject) => {
102 setTimeout(() => reject(new Error(`${this.constructor.name || 'Tracker'} init timeout`)), this.trackerInitTimeout)
103 })
104
105 try {
106 await Promise.race([initTimeout, this._initializeTracker()])
107 } catch (e) {
108 this.onInitializeFail(e)
109 }
110
111 return this.initializationComplete
112 }
113
114 /**
115 * Internal tracker initialization method to be implemented by sub trackers. This is

Callers 1

_initializeTrackerMethod · 0.45

Calls 1

_initializeTrackerMethod · 0.95

Tested by

no test coverage detected