better-all Best Practices
Model concurrent work as a dependency graph whose task names define the data flow, so independent operations run together while dependent operations remain explicit, inferred, cancellable, and predictable when failures occur.
Library Sources
- GitHub repository ID:
shuding/better-all - Context7 library ID:
/shuding/better-all - DeepWiki repository ID:
shuding/better-all
Use Context7 for current documentation and DeepWiki for implementation details.
Effective Strategies for better-all
Read the references that apply to the current task before writing or reviewing better-all code.
- Declare concurrency and data dependencies in the task graph.
- Declare direct data dependencies in the task graph so independent tasks run concurrently instead of being serialized by manual stages.
- Use method syntax for tasks that read sibling results so
this.$is the bound task context rather than lexicalthis.
- Let the graph own cancellation and failure semantics.
- Pass a child operation's task signal through when it accepts an
AbortSignal, so a sibling failure can stop that work without a second cancellation system. - Choose the matching graph operation when the caller needs either fail-fast behavior or every outcome instead of manually staging the dependency graph.
- Pass a child operation's task signal through when it accepts an
- Preserve result information that the task graph already proves.
- Retain inferred task results when task return types already describe the result object so duplicated result interfaces cannot drift.