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

Resolve with boolean, not emitted value

This commit is contained in:
Aaron Piotrowski 2016-08-23 12:50:16 -05:00
parent c89f10eef0
commit 3ce0c0dd37

View File

@ -40,10 +40,10 @@ class Observer {
* @param \Amp\Observable $observable
*/
public function __construct(Observable $observable) {
$deferred = &$this->deferred;
$values = &$this->values;
$deferreds = &$this->deferreds;
$resolved = &$this->resolved;
$deferred = &$this->deferred;
$values = &$this->values;
$deferreds = &$this->deferreds;
$resolved = &$this->resolved;
$observable->subscribe(static function ($value) use (&$deferred, &$values, &$deferreds, &$resolved) {
$values[] = $value;
@ -52,7 +52,7 @@ class Observer {
if ($deferred !== null) {
$temp = $deferred;
$deferred = null;
$temp->resolve($value);
$temp->resolve(true);
}
if ($resolved) {