mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-09-16 04:29:06 +00:00
update
This commit is contained in:
47
node_modules/rxjs/operator/dematerialize.js
generated
vendored
Normal file
47
node_modules/rxjs/operator/dematerialize.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
var dematerialize_1 = require('../operators/dematerialize');
|
||||
/**
|
||||
* Converts an Observable of {@link Notification} objects into the emissions
|
||||
* that they represent.
|
||||
*
|
||||
* <span class="informal">Unwraps {@link Notification} objects as actual `next`,
|
||||
* `error` and `complete` emissions. The opposite of {@link materialize}.</span>
|
||||
*
|
||||
* <img src="./img/dematerialize.png" width="100%">
|
||||
*
|
||||
* `dematerialize` is assumed to operate an Observable that only emits
|
||||
* {@link Notification} objects as `next` emissions, and does not emit any
|
||||
* `error`. Such Observable is the output of a `materialize` operation. Those
|
||||
* notifications are then unwrapped using the metadata they contain, and emitted
|
||||
* as `next`, `error`, and `complete` on the output Observable.
|
||||
*
|
||||
* Use this operator in conjunction with {@link materialize}.
|
||||
*
|
||||
* @example <caption>Convert an Observable of Notifications to an actual Observable</caption>
|
||||
* var notifA = new Rx.Notification('N', 'A');
|
||||
* var notifB = new Rx.Notification('N', 'B');
|
||||
* var notifE = new Rx.Notification('E', void 0,
|
||||
* new TypeError('x.toUpperCase is not a function')
|
||||
* );
|
||||
* var materialized = Rx.Observable.of(notifA, notifB, notifE);
|
||||
* var upperCase = materialized.dematerialize();
|
||||
* upperCase.subscribe(x => console.log(x), e => console.error(e));
|
||||
*
|
||||
* // Results in:
|
||||
* // A
|
||||
* // B
|
||||
* // TypeError: x.toUpperCase is not a function
|
||||
*
|
||||
* @see {@link Notification}
|
||||
* @see {@link materialize}
|
||||
*
|
||||
* @return {Observable} An Observable that emits items and notifications
|
||||
* embedded in Notification objects emitted by the source Observable.
|
||||
* @method dematerialize
|
||||
* @owner Observable
|
||||
*/
|
||||
function dematerialize() {
|
||||
return dematerialize_1.dematerialize()(this);
|
||||
}
|
||||
exports.dematerialize = dematerialize;
|
||||
//# sourceMappingURL=dematerialize.js.map
|
Reference in New Issue
Block a user