Skip to content

Commit b25556e

Browse files
committed
doc
1 parent 872fb5c commit b25556e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

doc/CHANGELOG-0.10.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
| `=> Future[CallbackTo[A]]` | `Callback.future(f)` | `Callback` |
1111
| `=> Future[CallbackTo[A]]` | `CallbackTo.future(f)` | `CallbackTo[Future[A]]` |
1212

13+
If you're looking for ways to block (eg. turning a `Callback[Future[A]]` into a `Callback[A]`),
14+
it is not supported by Scala.JS (See [#1996](https://github.com/scala-js/scala-js/issues/1996)).
15+
1316
**NOTE:** It's important that when going from `Future` to `Callback`, you're aware of when the `Future` is instantiated.
1417

1518
```scala
@@ -23,7 +26,7 @@
2326

2427
// This is BAD because the callback wraps a single instance of updateComponent.
2528
// 1) The server will be contacted immediately instead of when the callback executes.
26-
// 2) If the callback is execute more than once, the future and old result will be reused.
29+
// 2) If the callback is executed more than once, the future and old result will be reused.
2730
val f = updateComponent
2831
Callback.future(f)
2932

@@ -35,9 +38,6 @@
3538
}
3639
```
3740

38-
If you're looking for ways to block (eg. turning a `Callback[Future[A]]` into a `Callback[A]`),
39-
it is not supported by Scala.JS (See [#1996](https://github.com/scala-js/scala-js/issues/1996)).
40-
4141
* Add `CallbackOption.{pass,fail}`.
4242

4343
* Add `Callback{,Option}.voidExplicit`.

doc/USAGE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,9 @@ There are a number of conversions available to convert between `Callback` and `F
600600
| `=> Future[CallbackTo[A]]` | `Callback.future(f)` | `Callback` |
601601
| `=> Future[CallbackTo[A]]` | `CallbackTo.future(f)` | `CallbackTo[Future[A]]` |
602602

603+
If you're looking for ways to block (eg. turning a `Callback[Future[A]]` into a `Callback[A]`),
604+
it is not supported by Scala.JS (See [#1996](https://github.com/scala-js/scala-js/issues/1996)).
605+
603606
**NOTE:** It's important that when going from `Future` to `Callback`, you're aware of when the `Future` is instantiated.
604607

605608
```scala
@@ -613,7 +616,7 @@ Callback.future(updateComponent)
613616

614617
// This is BAD because the callback wraps a single instance of updateComponent.
615618
// 1) The server will be contacted immediately instead of when the callback executes.
616-
// 2) If the callback is execute more than once, the future and old result will be reused.
619+
// 2) If the callback is executed more than once, the future and old result will be reused.
617620
val f = updateComponent
618621
Callback.future(f)
619622

@@ -625,9 +628,6 @@ Callback.future {
625628
}
626629
```
627630

628-
If you're looking for ways to block (eg. turning a `Callback[Future[A]]` into a `Callback[A]`),
629-
it is not supported by Scala.JS (See [#1996](https://github.com/scala-js/scala-js/issues/1996)).
630-
631631

632632
Gotchas
633633
=======

0 commit comments

Comments
 (0)