chore(helpers) drop custom createDeferred() for Promise.withResolvers()

This commit is contained in:
Saúl Ibarra Corretgé
2024-10-22 14:23:27 +02:00
committed by Saúl Ibarra Corretgé
parent 4e0001c9af
commit 5bb3ba71d0
11 changed files with 1443 additions and 557 deletions

View File

@@ -14,7 +14,6 @@ import PersistenceRegistry from '../../redux/PersistenceRegistry';
import ReducerRegistry from '../../redux/ReducerRegistry';
import StateListenerRegistry from '../../redux/StateListenerRegistry';
import SoundCollection from '../../sounds/components/SoundCollection';
import { createDeferred } from '../../util/helpers';
import { appWillMount, appWillUnmount } from '../actions';
import logger from '../logger';
@@ -46,9 +45,7 @@ export default class BaseApp<P> extends Component<P, IState> {
/**
* The deferred for the initialisation {{promise, resolve, reject}}.
*/
_init: {
promise: Promise<any>;
};
_init: PromiseWithResolvers<any>
/**
* Initializes a new {@code BaseApp} instance.
@@ -79,7 +76,7 @@ export default class BaseApp<P> extends Component<P, IState> {
* @see {@link #_initStorage}
* @type {Promise}
*/
this._init = createDeferred<void>();
this._init = Promise.withResolvers();
try {
await this._initStorage();