This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fixes the "muted errors problem" of Promise.all. | |
* | |
* {@link betterPromiseAll} | |
* @see https://gist.github.com/Domiii/41c1dc504025e789fd8741f78d3ac528 | |
* @see https://dev.to/domiii/a-solution-to-the-deep-flaws-of-promiseall-1ldh | |
*/ | |
async function betterPromiseAll(promises) { | |
const results = await Promise.allSettled(promises); | |
const values = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** ########################################################################### | |
* Frontend Queries | |
* ##########################################################################*/ | |
const getPauseId = window.getPauseId = () => { | |
const state = app.store.getState(); | |
const pauseId = state?.pause?.id; | |
if (!pauseId) { | |
throw new Error(`Pause required (but not found) for snippet`); | |
} |
OlderNewer