Skip to content

Instantly share code, notes, and snippets.

/**
* 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 = [];
@Domiii
Domiii / devtools-snippet.js
Last active October 16, 2024 13:15
Replay Devtools Breakpoint Visualizer + more snippets
/** ###########################################################################
* 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`);
}