|
|
|
@ -75,17 +75,6 @@ export default class Vizality extends Updatable {
|
|
|
|
|
*/
|
|
|
|
|
await initializeWebpackModules();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set up a connectStoresAsync FLux method.
|
|
|
|
|
* @note This has to be after webpack modules have been initialized.
|
|
|
|
|
*/
|
|
|
|
|
const Flux = await getModule('Store', 'PersistedStore', true);
|
|
|
|
|
Flux.connectStoresAsync = (stores, fn) => Component =>
|
|
|
|
|
import('./components').AsyncComponent.from((async () => {
|
|
|
|
|
const awaitedStores = await Promise.all(stores);
|
|
|
|
|
return Flux.connectStores(awaitedStores, props => fn(awaitedStores, props))(Component);
|
|
|
|
|
})());
|
|
|
|
|
|
|
|
|
|
await this.handleConnectionOpen();
|
|
|
|
|
} catch (err) {
|
|
|
|
|
this.error(`Something went wrong while initializing webpack modules: ${err}`);
|
|
|
|
@ -99,6 +88,17 @@ export default class Vizality extends Updatable {
|
|
|
|
|
try {
|
|
|
|
|
await this.ensureWebpackModules();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set up a connectStoresAsync Flux method.
|
|
|
|
|
* @note This has to be after webpack modules have been initialized.
|
|
|
|
|
*/
|
|
|
|
|
const Flux = await getModule('Store', 'PersistedStore', true);
|
|
|
|
|
Flux.connectStoresAsync = (stores, fn) => Component =>
|
|
|
|
|
import('./components').AsyncComponent.from((async () => {
|
|
|
|
|
const awaitedStores = await Promise.all(stores);
|
|
|
|
|
return Flux.connectStores(awaitedStores, props => fn(awaitedStores, props))(Component);
|
|
|
|
|
})());
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get rid of Discord's "Hold Up" dev tools warning.
|
|
|
|
|
*/
|
|
|
|
|