Skip to content

Commit fc10f22

Browse files
authored
Update packages/core/CHANGELOG.md
1 parent 39c2316 commit fc10f22

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

packages/core/CHANGELOG.md

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,6 @@
2727
2828
- 801246b: Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller).
2929

30-
One example use case is automatically cancelling a prompt after a timeout.
31-
32-
```ts
33-
const shouldContinue = await confirm({
34-
message: "This message will self destruct in 5 seconds",
35-
signal: AbortSignal.timeout(5000),
36-
});
37-
```
38-
39-
Another use case is racing a long running task with a manual prompt.
40-
41-
```ts
42-
const abortController = new AbortController();
43-
44-
const projectType = await Promise.race([
45-
detectProjectType({
46-
signal: abortController.signal,
47-
}),
48-
select({
49-
message: "Pick a project type.",
50-
options: [
51-
{ value: "ts", label: "TypeScript" },
52-
{ value: "js", label: "JavaScript" },
53-
{ value: "coffee", label: "CoffeeScript", hint: "oh no" },
54-
],
55-
signal: abortController.signal,
56-
}),
57-
]);
58-
59-
abortController.abort();
60-
```
6130

6231
- a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the `escape` key to cancel (`ctrl+c`).
6332

0 commit comments

Comments
 (0)