diff --git a/doc/CHANGELOG-0.10.md b/doc/CHANGELOG-0.10.md index 5b2b7f6f2..b36ca6e07 100644 --- a/doc/CHANGELOG-0.10.md +++ b/doc/CHANGELOG-0.10.md @@ -10,6 +10,9 @@ | `=> Future[CallbackTo[A]]` | `Callback.future(f)` | `Callback` | | `=> Future[CallbackTo[A]]` | `CallbackTo.future(f)` | `CallbackTo[Future[A]]` | + If you're looking for ways to block (eg. turning a `Callback[Future[A]]` into a `Callback[A]`), + it is not supported by Scala.JS (See [#1996](https://github.com/scala-js/scala-js/issues/1996)). + **NOTE:** It's important that when going from `Future` to `Callback`, you're aware of when the `Future` is instantiated. ```scala @@ -23,7 +26,7 @@ // This is BAD because the callback wraps a single instance of updateComponent. // 1) The server will be contacted immediately instead of when the callback executes. - // 2) If the callback is execute more than once, the future and old result will be reused. + // 2) If the callback is executed more than once, the future and old result will be reused. val f = updateComponent Callback.future(f) @@ -35,9 +38,6 @@ } ``` - If you're looking for ways to block (eg. turning a `Callback[Future[A]]` into a `Callback[A]`), - it is not supported by Scala.JS (See [#1996](https://github.com/scala-js/scala-js/issues/1996)). - * Add `CallbackOption.{pass,fail}`. * Add `Callback{,Option}.voidExplicit`. diff --git a/doc/USAGE.md b/doc/USAGE.md index 9daa4cbcb..ffbc826d8 100644 --- a/doc/USAGE.md +++ b/doc/USAGE.md @@ -600,6 +600,9 @@ There are a number of conversions available to convert between `Callback` and `F | `=> Future[CallbackTo[A]]` | `Callback.future(f)` | `Callback` | | `=> Future[CallbackTo[A]]` | `CallbackTo.future(f)` | `CallbackTo[Future[A]]` | +If you're looking for ways to block (eg. turning a `Callback[Future[A]]` into a `Callback[A]`), +it is not supported by Scala.JS (See [#1996](https://github.com/scala-js/scala-js/issues/1996)). + **NOTE:** It's important that when going from `Future` to `Callback`, you're aware of when the `Future` is instantiated. ```scala @@ -613,7 +616,7 @@ Callback.future(updateComponent) // This is BAD because the callback wraps a single instance of updateComponent. // 1) The server will be contacted immediately instead of when the callback executes. -// 2) If the callback is execute more than once, the future and old result will be reused. +// 2) If the callback is executed more than once, the future and old result will be reused. val f = updateComponent Callback.future(f) @@ -625,9 +628,6 @@ Callback.future { } ``` -If you're looking for ways to block (eg. turning a `Callback[Future[A]]` into a `Callback[A]`), -it is not supported by Scala.JS (See [#1996](https://github.com/scala-js/scala-js/issues/1996)). - Gotchas =======