Skip to content

Fetch request body as ReadableStream #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Nov 17, 2021
Prev Previous commit
Next Next commit
Fix casts in ReadableStream tests for Scala 2.12.
  • Loading branch information
ptrdom committed Nov 11, 2021
commit d3b38eda21af3603494e85e36ec8a1a57ba473a9
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.scalajs.dom.tests.shared.AsyncTesting.async
import scala.concurrent.Future
import scala.scalajs.js
import scala.scalajs.js.Thenable.Implicits._
import scala.scalajs.js.|

trait BrowserTests {

Expand All @@ -26,11 +27,11 @@ trait BrowserTests {

val stream = ReadableStream[Tuna](
new ReadableStreamUnderlyingSource[Tuna] {
start = { (controller: ReadableStreamController[Tuna]) =>
start = js.defined({ (controller: ReadableStreamController[Tuna]) =>
controller.enqueue(Tuna("blue"))
controller.enqueue(Tuna("red"))
controller.close()
}: js.Function1[ReadableStreamController[Tuna], Unit]
}): js.UndefOr[js.Function1[ReadableStreamController[Tuna], Unit | js.Promise[Unit]]]
}
)

Expand Down