Rx.Notification.createOnNext(value)

Creates an object that represents an OnNext notification to an observer.

参数

  1. value (Any): The value contained in the notification.

返回值

(Notification): The OnNext notification containing the value.

Example

var source = Rx.Observable
    .fromArray([
        Rx.Notification.createOnNext(42),
        Rx.Notification.createOnCompleted()
    ])
    .dematerialize();

var subscription = source.subscribe(
  x => console.log(`onNext: ${x}`),
  e => console.log(`onError: ${e}`),
  () => console.log('onCompleted'));

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