Skip to content

Commit 4dd3585

Browse files
authored
Merge pull request #375 from dorklein/main
docs: Fix computedFrom example in async computed documentation
2 parents def666f + 75bddeb commit 4dd3585

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

website/src/content/docs/async/computed.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ of the signal. This callback is converted into a Computed signal.
2222
final movieId = signal('id');
2323
late final movie = computedAsync(() => fetchMovie(movieId()));
2424
```
25+
2526
:::caution
2627
It is important that signals are called before any async gaps with await.
2728
:::
@@ -39,7 +40,7 @@ compute the value of the signal every time one of the signals changes.
3940

4041
```dart
4142
final movieId = signal('id');
42-
late final movie = computedFrom(args, ([movieId]) => fetchMovie(args.first));
43+
late final movie = computedFrom([movieId], (args) => fetchMovie(args.first));
4344
```
4445

4546
Since all dependencies are passed in as arguments there is no need to worry about calling the signals before any async gaps with await.

0 commit comments

Comments
 (0)