Repository navigation
Expand file tree
/
Copy pathcontext7.json
More file actions
23 lines (23 loc) · 1.57 KB
/
Copy pathcontext7.json
File metadata and controls
23 lines (23 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"$schema": "https://context7.com/schema/context7.json",
"projectTitle": "canc",
"description": "Cancelable promise ecosystem based on native Promise: coroutines, async iterators, decorators, utilities, third-party library helpers.",
"folders": ["docs", "packages"],
"excludeFolders": [
".github",
".changeset",
"benchmarks",
"examples",
"scripts"
],
"excludeFiles": ["package-lock.json", "CHANGELOG.md"],
"rules": [
"CancelablePromise extends native Promise. Cancellation is represented as a rejection with a CancelError.",
"Cancellation propagates DOWN promise chains (rejection) and bubbles UP when all child promises are canceled and the value is unconsumed.",
"CancelablePromise.race and .any cancel losing promises; CancelablePromise.all cancels remaining promises on first rejection or when all itself is canceled.",
"Never check error identity with instanceof across package boundaries; use isCancelError() guards or catchCancel/suppressCancel/catchAbort/suppressAbort/catchTimeout/suppressTimeout helpers.",
"No cancel errors should remain unhandled; use isCancelError, catchCancel(), suppressCancel(), catchAbort(), or suppressAbort() to handle them locally; use @cancjs/unhandled-rejection to handle them globally.",
"Prefer CancelablePromise chains and canc-coroutine over manually threading AbortController signals through function boundaries.",
"Avoid using CancelablePromise and AbortController constructors directly; prefer higher-level promisify() and cancelify() helpers to create cancelable promises from external APIs."
]
}