1
0
mirror of https://github.com/danog/amp.git synced 2024-11-30 04:29:08 +01:00

Fix stream()

This commit is contained in:
Aaron Piotrowski 2016-07-19 15:24:05 -05:00
parent 24142496d8
commit 8e794ba1d7

View File

@ -592,7 +592,7 @@ function merge(array $observables) {
/**
* Creates an observable from the given array of observables, emitting the success value of each provided awaitable or
* Creates an observable from the given array of awaitables, emitting the success value of each provided awaitable or
* failing if any awaitable fails.
*
* @param \Interop\Async\Awaitable[] $awaitables
@ -603,8 +603,8 @@ function stream(array $awaitables) {
$postponed = new Postponed;
if (empty($awaitables)) {
$postponed->complete();
return $postponed;
$postponed->resolve();
return $postponed->getObservable();
}
$pending = \count($awaitables);
@ -634,7 +634,7 @@ function stream(array $awaitables) {
$awaitable->when($onResolved);
}
return $postponed;
return $postponed->getObservable();
}
/**