Skip to content

Commit 2871e8f

Browse files
Update documentation
1 parent 62379df commit 2871e8f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* `Future()` ➡️ `CancellableFuture.from()`
55
* `Future.microtask()` ➡️ `CancellableFuture.microtask()`
66
* `Future.sync()` ➡️ `CancellableFuture.sync()`
7+
* `Future.value()` ➡️ `CancellableFuture.value()`
78
* `Future.delayed()` ➡️ `CancellableFuture.delayed()`
89
* **Breaking:** The `CancellableFuture` constructor is now private. Calls to this constuctor should be replaced with `.asCancellable()` or `CancellableFuture.value()`:
910
```dart

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ When a TimeoutCancellationToken is created, the timer will begin immediately. To
2626

2727
## Usage
2828

29-
### Cancelling Futures
29+
### Cancellable Future
3030

31-
To make an existing future cancellable, you can use the `.asCancellable()`
32-
extension.
31+
The CancellableFuture class provides cancellable versions for many of Dart's Future constructors, including:
32+
* `Future()` ➡️ `CancellableFuture.from()`
33+
* `Future.microtask()` ➡️ `CancellableFuture.microtask()`
34+
* `Future.sync()` ➡️ `CancellableFuture.sync()`
35+
* `Future.value()` ➡️ `CancellableFuture.value()`
36+
* `Future.delayed()` ➡️ `CancellableFuture.delayed()`
37+
38+
To make existing futures cancellable, you can also use the `.asCancellable()` extension.
3339

3440
```dart
3541
CancellationToken cancellationToken = CancellationToken();

0 commit comments

Comments
 (0)