Skip to content

Latest commit

 

History

History
49 lines (29 loc) · 1.05 KB

File metadata and controls

49 lines (29 loc) · 1.05 KB

Creates an observer from the specified onNext, onError, and onCompleted actions.

Arguments

  1. [onNext] (Function): Observer's onNext action implementation.
  2. [onError] (Function): Observer's onError action implementation.
  3. [onCompleted] (Function): Observer's onCompleted action implementation.

Returns

(Observer): The observer object implemented using the given actions.

{% if book.isPdf == true %}

var source = Rx.Observable.return(42);

var observer = Rx.Observer.create(
  x => console.log(`onNext: ${x}`),
  e => console.log(`onError: ${e}`),
  () => console.log('onCompleted'));

var subscription = source.subscribe(observer);

// => onNext: 42
// => onCompleted

{% else %}

Example

{% endif %}

{% if book.isPdf %}

{% else %}

Location

  • rx.js

{% endif %}