mirror of
https://github.com/danog/amp.git
synced 2024-11-30 04:29:08 +01:00
Fix stream()
This commit is contained in:
parent
24142496d8
commit
8e794ba1d7
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user