PHP Class Rx\React\Promise

Show file Open project: ReactiveX/RxPHP Class Usage Examples

Public Methods

Method Description
fromObservable ( Rx\ObservableInterface $observable, Deferred $deferred = null ) : Promise Converts an existing observable sequence to React Promise
rejected ( mixed $exception ) : Promise
resolved ( mixed $value ) : Promise
toObservable ( React\Promise\CancellablePromiseInterface $promise ) : Rx\Observable\AnonymousObservable Converts a Promise to an Observable sequence

Method Details

fromObservable() public static method

Converts an existing observable sequence to React Promise
public static fromObservable ( Rx\ObservableInterface $observable, Deferred $deferred = null ) : Promise
$observable Rx\ObservableInterface
$deferred React\Promise\Deferred
return React\Promise\Promise

rejected() public static method

public static rejected ( mixed $exception ) : Promise
$exception mixed
return React\Promise\Promise A promise rejected with $exception

resolved() public static method

public static resolved ( mixed $value ) : Promise
$value mixed
return React\Promise\Promise A promise resolved to $value

toObservable() public static method

Converts a Promise to an Observable sequence
public static toObservable ( React\Promise\CancellablePromiseInterface $promise ) : Rx\Observable\AnonymousObservable
$promise React\Promise\CancellablePromiseInterface
return Rx\Observable\AnonymousObservable