MCPcopy Create free account
hub / github.com/facebook/Rapid / initAsync

Method initAsync

modules/core/Map3dSystem.js:61–84  ·  view source on GitHub ↗

* initAsync * Called after all core objects have been constructed. * @return {Promise} Promise resolved when this component has completed initialization

()

Source from the content-addressed store, hash-verified

59 * @return {Promise} Promise resolved when this component has completed initialization
60 */
61 initAsync() {
62 for (const id of this.dependencies) {
63 if (!this.context.systems[id]) {
64 return Promise.reject(`Cannot init: ${this.id} requires ${id}`);
65 }
66 }
67
68 const context = this.context;
69 const l10n = context.systems.l10n;
70 const urlhash = context.systems.urlhash;
71
72 const prerequisites = Promise.all([
73 l10n.initAsync(),
74 urlhash.initAsync()
75 ]);
76
77 return this._initPromise = prerequisites
78 .then(() => {
79 // Setup event handlers..
80 urlhash.on('hashchange', this._hashchange);
81 l10n.on('localechange', this._setupKeybinding);
82 this._setupKeybinding();
83 });
84 }
85
86
87 /**

Callers

nothing calls this directly

Calls 2

_setupKeybindingMethod · 0.95
onMethod · 0.45

Tested by

no test coverage detected