Skip to content

Commit c1a9af3

Browse files
committed
Doc(*): Remove depreciated methods from the README
1 parent c6a79cd commit c1a9af3

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

packages/prompts/README.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const allowEmail = await confirm(
192192

193193
## Canceling prompt
194194

195-
This can preferably be done with either an `AbortController` or `AbortSignal`.
195+
This can be done with either an `AbortController` or `AbortSignal`.
196196

197197
```js
198198
// Example 1: using built-in AbortSignal utilities
@@ -202,7 +202,7 @@ const answer = await confirm({ ... }, { signal: AbortSignal.timeout(5000) });
202202
```
203203

204204
```js
205-
// Example 1: implementing custom cancellation logic
205+
// Example 2: implementing custom cancellation with an AbortController
206206
import { confirm } from '@inquirer/prompts';
207207

208208
const controller = new AbortController();
@@ -213,18 +213,6 @@ setTimeout(() => {
213213
const answer = await confirm({ ... }, { signal: controller.signal });
214214
```
215215

216-
Alternatively, all prompt functions are returning a cancelable promise. This special promise type has a `cancel` method that'll cancel and cleanup the prompt.
217-
218-
On calling `cancel`, the answer promise will become rejected.
219-
220-
```js
221-
import { confirm } from '@inquirer/prompts';
222-
223-
const promise = confirm(...); // Warning: for this pattern to work, `await` cannot be used.
224-
225-
promise.cancel();
226-
```
227-
228216
# Recipes
229217

230218
## Handling `ctrl+c` gracefully

0 commit comments

Comments
 (0)