1 | "use strict";
|
2 | var pluck_1 = require('rxjs/operator/pluck');
|
3 | var map_1 = require('rxjs/operator/map');
|
4 | var distinctUntilChanged_1 = require('rxjs/operator/distinctUntilChanged');
|
5 | function select(pathOrMapFn) {
|
6 | var paths = [];
|
7 | for (var _i = 1; _i < arguments.length; _i++) {
|
8 | paths[_i - 1] = arguments[_i];
|
9 | }
|
10 | var mapped$;
|
11 | if (typeof pathOrMapFn === 'string') {
|
12 | mapped$ = pluck_1.pluck.call.apply(pluck_1.pluck, [this, pathOrMapFn].concat(paths));
|
13 | }
|
14 | else if (typeof pathOrMapFn === 'function') {
|
15 | mapped$ = map_1.map.call(this, pathOrMapFn);
|
16 | }
|
17 | else {
|
18 | throw new TypeError(("Unexpected type " + typeof pathOrMapFn + " in select operator,")
|
19 | + " expected 'string' or 'function'");
|
20 | }
|
21 | return distinctUntilChanged_1.distinctUntilChanged.call(mapped$);
|
22 | }
|
23 | exports.select = select;
|