File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 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
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
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 ` .
Original file line number Diff line number Diff 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.
617620val f = updateComponent
618621Callback .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
632632Gotchas
633633=======
You can’t perform that action at this time.
0 commit comments