finds.dev← search

// the find

shuding/better-all

★ 1,107 · TypeScript · MIT · updated Aug 2026

Better Promise.all with automatic dependency optimization

A small TypeScript helper that runs an object of async tasks concurrently, letting each task await its siblings through `this.$`, so the dependency graph comes from the code rather than a hand-declared structure. It is aimed at application code that fans out several fetches with some ordering between them, not at a general-purpose task scheduler.

- Dependencies are written as plain `await this.$.name` inside each task, so the graph stays implicit and the naive-versus-manual scheduling trade-off goes away. The README's 11s-versus-20s example is the case it is built for.

- Result and dependency types are inferred from the task object, so `result.combined` and the reads inside tasks are typed without a manual generic. Hand-written nested `.then` chains lose that quickly.

- `this.$signal` aborts sibling tasks when one fails in `all()`, which matters when the tasks are LLM or network calls you do not want to keep paying for after a failure.

- The `debug: true` waterfall separates time spent blocked on a dependency from time spent running, which is the number you need to decide whether a restructure is worth doing.

- `flow()` implements early exit by having `$end()` throw internally and then silently swallowing that throw in dependents. A dependent with a broad try/catch will mask the exit and keep running, and nothing in the signature enforces against this, so the failure mode is quiet.

- `allSettled()` does not abort siblings on failure while `all()` does, so the signal semantics differ between the two main entry points. Someone who learns one will be surprised by the other.

- The mechanism depends entirely on the `this` binding. It is easy to lose by extracting a task into a named function or passing it as a callback, and the type system will not always catch that.

- The README claims 'minimal dependencies' and 'small bundle size' without numbers. For a helper this small the claim is cheap to check, and it should be measured before anyone adopts the library on the strength of it.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →