new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isEmpty.js","sources":["../../src/add/operator/isEmpty.ts"],"names":[],"mappings":";;AAAA,4CAA0C"}
|
||||
@@ -0,0 +1,31 @@
|
||||
import { AsyncAction } from './AsyncAction';
|
||||
import { AsyncScheduler } from './AsyncScheduler';
|
||||
|
||||
export class AnimationFrameScheduler extends AsyncScheduler {
|
||||
public flush(action?: AsyncAction<any>): void {
|
||||
|
||||
this.active = true;
|
||||
this.scheduled = undefined;
|
||||
|
||||
const {actions} = this;
|
||||
let error: any;
|
||||
let index: number = -1;
|
||||
let count: number = actions.length;
|
||||
action = action || actions.shift();
|
||||
|
||||
do {
|
||||
if (error = action.execute(action.state, action.delay)) {
|
||||
break;
|
||||
}
|
||||
} while (++index < count && (action = actions.shift()));
|
||||
|
||||
this.active = false;
|
||||
|
||||
if (error) {
|
||||
while (++index < count && (action = actions.shift())) {
|
||||
action.unsubscribe();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/operators/findIndex"));
|
||||
//# sourceMappingURL=findIndex.js.map
|
||||
@@ -0,0 +1,17 @@
|
||||
import { ObservableInput, OperatorFunction, MonoTypeOperatorFunction, SchedulerLike } from '../types';
|
||||
/** @deprecated Deprecated in favor of static concat. */
|
||||
export declare function concat<T>(scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
|
||||
/** @deprecated Deprecated in favor of static concat. */
|
||||
export declare function concat<T, T2>(v2: ObservableInput<T2>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2>;
|
||||
/** @deprecated Deprecated in favor of static concat. */
|
||||
export declare function concat<T, T2, T3>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3>;
|
||||
/** @deprecated Deprecated in favor of static concat. */
|
||||
export declare function concat<T, T2, T3, T4>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4>;
|
||||
/** @deprecated Deprecated in favor of static concat. */
|
||||
export declare function concat<T, T2, T3, T4, T5>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5>;
|
||||
/** @deprecated Deprecated in favor of static concat. */
|
||||
export declare function concat<T, T2, T3, T4, T5, T6>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler?: SchedulerLike): OperatorFunction<T, T | T2 | T3 | T4 | T5 | T6>;
|
||||
/** @deprecated Deprecated in favor of static concat. */
|
||||
export declare function concat<T>(...observables: Array<ObservableInput<T> | SchedulerLike>): MonoTypeOperatorFunction<T>;
|
||||
/** @deprecated Deprecated in favor of static concat. */
|
||||
export declare function concat<T, R>(...observables: Array<ObservableInput<any> | SchedulerLike>): OperatorFunction<T, R>;
|
||||
@@ -0,0 +1,50 @@
|
||||
interface Fragment {
|
||||
key: string | null;
|
||||
first: null;
|
||||
c: () => void;
|
||||
l: (nodes: any) => void;
|
||||
h: () => void;
|
||||
m: (target: HTMLElement, anchor: any) => void;
|
||||
p: (ctx: any, dirty: any) => void;
|
||||
r: () => void;
|
||||
f: () => void;
|
||||
a: () => void;
|
||||
i: (local: any) => void;
|
||||
o: (local: any) => void;
|
||||
d: (detaching: 0 | 1) => void;
|
||||
}
|
||||
interface T$$ {
|
||||
dirty: number[];
|
||||
ctx: null | any;
|
||||
bound: any;
|
||||
update: () => void;
|
||||
callbacks: any;
|
||||
after_update: any[];
|
||||
props: Record<string, 0 | string>;
|
||||
fragment: null | false | Fragment;
|
||||
not_equal: any;
|
||||
before_update: any[];
|
||||
context: Map<any, any>;
|
||||
on_mount: any[];
|
||||
on_destroy: any[];
|
||||
skip_bound: boolean;
|
||||
on_disconnect: any[];
|
||||
}
|
||||
export declare function bind(component: any, name: any, callback: any): void;
|
||||
export declare function create_component(block: any): void;
|
||||
export declare function claim_component(block: any, parent_nodes: any): void;
|
||||
export declare function mount_component(component: any, target: any, anchor: any, customElement: any): void;
|
||||
export declare function destroy_component(component: any, detaching: any): void;
|
||||
export declare function init(component: any, options: any, instance: any, create_fragment: any, not_equal: any, props: any, dirty?: number[]): void;
|
||||
export declare let SvelteElement: any;
|
||||
/**
|
||||
* Base class for Svelte components. Used when dev=false.
|
||||
*/
|
||||
export declare class SvelteComponent {
|
||||
$$: T$$;
|
||||
$$set?: ($$props: any) => void;
|
||||
$destroy(): void;
|
||||
$on(type: any, callback: any): () => void;
|
||||
$set($$props: any): void;
|
||||
}
|
||||
export {};
|
||||
@@ -0,0 +1,8 @@
|
||||
import assertString from './util/assertString';
|
||||
import includes from './util/includes'; // from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
|
||||
|
||||
var validISO31661Alpha3CountriesCodes = ['AFG', 'ALA', 'ALB', 'DZA', 'ASM', 'AND', 'AGO', 'AIA', 'ATA', 'ATG', 'ARG', 'ARM', 'ABW', 'AUS', 'AUT', 'AZE', 'BHS', 'BHR', 'BGD', 'BRB', 'BLR', 'BEL', 'BLZ', 'BEN', 'BMU', 'BTN', 'BOL', 'BES', 'BIH', 'BWA', 'BVT', 'BRA', 'IOT', 'BRN', 'BGR', 'BFA', 'BDI', 'KHM', 'CMR', 'CAN', 'CPV', 'CYM', 'CAF', 'TCD', 'CHL', 'CHN', 'CXR', 'CCK', 'COL', 'COM', 'COG', 'COD', 'COK', 'CRI', 'CIV', 'HRV', 'CUB', 'CUW', 'CYP', 'CZE', 'DNK', 'DJI', 'DMA', 'DOM', 'ECU', 'EGY', 'SLV', 'GNQ', 'ERI', 'EST', 'ETH', 'FLK', 'FRO', 'FJI', 'FIN', 'FRA', 'GUF', 'PYF', 'ATF', 'GAB', 'GMB', 'GEO', 'DEU', 'GHA', 'GIB', 'GRC', 'GRL', 'GRD', 'GLP', 'GUM', 'GTM', 'GGY', 'GIN', 'GNB', 'GUY', 'HTI', 'HMD', 'VAT', 'HND', 'HKG', 'HUN', 'ISL', 'IND', 'IDN', 'IRN', 'IRQ', 'IRL', 'IMN', 'ISR', 'ITA', 'JAM', 'JPN', 'JEY', 'JOR', 'KAZ', 'KEN', 'KIR', 'PRK', 'KOR', 'KWT', 'KGZ', 'LAO', 'LVA', 'LBN', 'LSO', 'LBR', 'LBY', 'LIE', 'LTU', 'LUX', 'MAC', 'MKD', 'MDG', 'MWI', 'MYS', 'MDV', 'MLI', 'MLT', 'MHL', 'MTQ', 'MRT', 'MUS', 'MYT', 'MEX', 'FSM', 'MDA', 'MCO', 'MNG', 'MNE', 'MSR', 'MAR', 'MOZ', 'MMR', 'NAM', 'NRU', 'NPL', 'NLD', 'NCL', 'NZL', 'NIC', 'NER', 'NGA', 'NIU', 'NFK', 'MNP', 'NOR', 'OMN', 'PAK', 'PLW', 'PSE', 'PAN', 'PNG', 'PRY', 'PER', 'PHL', 'PCN', 'POL', 'PRT', 'PRI', 'QAT', 'REU', 'ROU', 'RUS', 'RWA', 'BLM', 'SHN', 'KNA', 'LCA', 'MAF', 'SPM', 'VCT', 'WSM', 'SMR', 'STP', 'SAU', 'SEN', 'SRB', 'SYC', 'SLE', 'SGP', 'SXM', 'SVK', 'SVN', 'SLB', 'SOM', 'ZAF', 'SGS', 'SSD', 'ESP', 'LKA', 'SDN', 'SUR', 'SJM', 'SWZ', 'SWE', 'CHE', 'SYR', 'TWN', 'TJK', 'TZA', 'THA', 'TLS', 'TGO', 'TKL', 'TON', 'TTO', 'TUN', 'TUR', 'TKM', 'TCA', 'TUV', 'UGA', 'UKR', 'ARE', 'GBR', 'USA', 'UMI', 'URY', 'UZB', 'VUT', 'VEN', 'VNM', 'VGB', 'VIR', 'WLF', 'ESH', 'YEM', 'ZMB', 'ZWE'];
|
||||
export default function isISO31661Alpha3(str) {
|
||||
assertString(str);
|
||||
return includes(validISO31661Alpha3CountriesCodes, str.toUpperCase());
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Subject } from '../Subject';
|
||||
/**
|
||||
* Determines whether the ErrorObserver is closed or stopped or has a
|
||||
* destination that is closed or stopped - in which case errors will
|
||||
* need to be reported via a different mechanism.
|
||||
* @param observer the observer
|
||||
*/
|
||||
export declare function canReportError(observer: Subscriber<any> | Subject<any>): boolean;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"skipWhile.js","sources":["../../src/add/operator/skipWhile.ts"],"names":[],"mappings":";;AAAA,8CAA4C"}
|
||||
@@ -0,0 +1,71 @@
|
||||
# import-from [](https://travis-ci.org/sindresorhus/import-from)
|
||||
|
||||
> Import a module like with [`require()`](https://nodejs.org/api/modules.html#modules_require_id) but from a given path
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install import-from
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const importFrom = require('import-from');
|
||||
|
||||
// There is a file at `./foo/bar.js`
|
||||
|
||||
importFrom('foo', './bar');
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### importFrom(fromDirectory, moduleId)
|
||||
|
||||
Like `require()`, throws when the module can't be found.
|
||||
|
||||
### importFrom.silent(fromDirectory, moduleId)
|
||||
|
||||
Returns `undefined` instead of throwing when the module can't be found.
|
||||
|
||||
#### fromDirectory
|
||||
|
||||
Type: `string`
|
||||
|
||||
Directory to import from.
|
||||
|
||||
#### moduleId
|
||||
|
||||
Type: `string`
|
||||
|
||||
What you would use in `require()`.
|
||||
|
||||
|
||||
## Tip
|
||||
|
||||
Create a partial using a bound function if you want to import from the same `fromDir` multiple times:
|
||||
|
||||
```js
|
||||
const importFromFoo = importFrom.bind(null, 'foo');
|
||||
|
||||
importFromFoo('./bar');
|
||||
importFromFoo('./baz');
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path
|
||||
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
|
||||
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily
|
||||
- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/util/hostReportError';
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/operator/publish"));
|
||||
//# sourceMappingURL=publish.js.map
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB","2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB DC EC"},D:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB","2":"G B C H M N O v eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d OC PC QC RC qB 9B SC rB","4":"z","16":"0 w x y"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"2":"tB I D oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"2":"A B C e qB 9B rB"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"1":"I vC wC xC yC zC 0B","2":"0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"2":"1B"},R:{"2":"8C"},S:{"1":"9C"}},B:6,C:"HTTP Public Key Pinning"};
|
||||
@@ -0,0 +1,7 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "10"
|
||||
- "12"
|
||||
- "node"
|
||||
after_script:
|
||||
- npm run coveralls
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"distinctUntilChanged.js","sources":["../../../src/internal/operators/distinctUntilChanged.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA8D3C,MAAM,UAAU,oBAAoB,CAAO,OAAiC,EAAE,WAAyB;IACrG,OAAO,CAAC,MAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,4BAA4B,CAAO,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9G,CAAC;AAED,MAAM,4BAA4B;IAChC,YAAoB,OAAgC,EAChC,WAAwB;QADxB,YAAO,GAAP,OAAO,CAAyB;QAChC,gBAAW,GAAX,WAAW,CAAa;IAC5C,CAAC;IAED,IAAI,CAAC,UAAyB,EAAE,MAAW;QACzC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,8BAA8B,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1G,CAAC;CACF;AAOD,MAAM,8BAAqC,SAAQ,UAAa;IAI9D,YAAY,WAA0B,EAC1B,OAAgC,EACxB,WAAwB;QAC1C,KAAK,CAAC,WAAW,CAAC,CAAC;QADD,gBAAW,GAAX,WAAW,CAAa;QAJpC,WAAM,GAAY,KAAK,CAAC;QAM9B,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;YACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;SACxB;IACH,CAAC;IAEO,OAAO,CAAC,CAAM,EAAE,CAAM;QAC5B,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAES,KAAK,CAAC,KAAQ;QACtB,IAAI,GAAQ,CAAC;QACb,IAAI;YACF,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YAC7B,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;SAChD;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpC;QACD,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI;gBACF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;gBACzB,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;aACjC;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACpC;SACF;aAAM;YACL,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;SACpB;QACD,IAAI,CAAC,MAAM,EAAE;YACX,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;YACf,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9B;IACH,CAAC;CACF"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ReplaySubject.js","sources":["src/ReplaySubject.ts"],"names":[],"mappings":";;;;;AAAA,+CAA0C"}
|
||||
@@ -0,0 +1,46 @@
|
||||
'use strict';
|
||||
const {Transform} = require('stream');
|
||||
|
||||
class ObjectTransform extends Transform {
|
||||
constructor() {
|
||||
super({
|
||||
objectMode: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class FilterStream extends ObjectTransform {
|
||||
constructor(filter) {
|
||||
super();
|
||||
this._filter = filter;
|
||||
}
|
||||
|
||||
_transform(data, encoding, callback) {
|
||||
if (this._filter(data)) {
|
||||
this.push(data);
|
||||
}
|
||||
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
class UniqueStream extends ObjectTransform {
|
||||
constructor() {
|
||||
super();
|
||||
this._pushed = new Set();
|
||||
}
|
||||
|
||||
_transform(data, encoding, callback) {
|
||||
if (!this._pushed.has(data)) {
|
||||
this.push(data);
|
||||
this._pushed.add(data);
|
||||
}
|
||||
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
FilterStream,
|
||||
UniqueStream
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","2":"C K L H M N O"},C:{"1":"vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB DC EC"},D:{"1":"dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB","196":"ZB vB aB bB","324":"cB"},E:{"2":"I u J E F G A B C GC zB HC IC JC KC 0B qB","516":"K L H rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB OC PC QC RC qB 9B SC rB"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"2":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:5,C:"Server Timing"};
|
||||
@@ -0,0 +1,67 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { AsyncSubject } from '../AsyncSubject';
|
||||
import { multicast } from './multicast';
|
||||
import { ConnectableObservable } from '../observable/ConnectableObservable';
|
||||
import { UnaryFunction } from '../types';
|
||||
|
||||
/**
|
||||
* Returns a connectable observable sequence that shares a single subscription to the
|
||||
* underlying sequence containing only the last notification.
|
||||
*
|
||||
* 
|
||||
*
|
||||
* Similar to {@link publish}, but it waits until the source observable completes and stores
|
||||
* the last emitted value.
|
||||
* Similarly to {@link publishReplay} and {@link publishBehavior}, this keeps storing the last
|
||||
* value even if it has no more subscribers. If subsequent subscriptions happen, they will
|
||||
* immediately get that last stored value and complete.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* ```ts
|
||||
* import { interval } from 'rxjs';
|
||||
* import { publishLast, tap, take } from 'rxjs/operators';
|
||||
*
|
||||
* const connectable =
|
||||
* interval(1000)
|
||||
* .pipe(
|
||||
* tap(x => console.log("side effect", x)),
|
||||
* take(3),
|
||||
* publishLast());
|
||||
*
|
||||
* connectable.subscribe(
|
||||
* x => console.log( "Sub. A", x),
|
||||
* err => console.log("Sub. A Error", err),
|
||||
* () => console.log( "Sub. A Complete"));
|
||||
*
|
||||
* connectable.subscribe(
|
||||
* x => console.log( "Sub. B", x),
|
||||
* err => console.log("Sub. B Error", err),
|
||||
* () => console.log( "Sub. B Complete"));
|
||||
*
|
||||
* connectable.connect();
|
||||
*
|
||||
* // Results:
|
||||
* // "side effect 0"
|
||||
* // "side effect 1"
|
||||
* // "side effect 2"
|
||||
* // "Sub. A 2"
|
||||
* // "Sub. B 2"
|
||||
* // "Sub. A Complete"
|
||||
* // "Sub. B Complete"
|
||||
* ```
|
||||
*
|
||||
* @see {@link ConnectableObservable}
|
||||
* @see {@link publish}
|
||||
* @see {@link publishReplay}
|
||||
* @see {@link publishBehavior}
|
||||
*
|
||||
* @return {ConnectableObservable} An observable sequence that contains the elements of a
|
||||
* sequence produced by multicasting the source sequence.
|
||||
* @method publishLast
|
||||
* @owner Observable
|
||||
*/
|
||||
|
||||
export function publishLast<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>> {
|
||||
return (source: Observable<T>) => multicast(new AsyncSubject<T>())(source);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
'use strict';
|
||||
var { fromEvent } = require('rxjs');
|
||||
var { filter, map, share, takeUntil } = require('rxjs/operators');
|
||||
|
||||
function normalizeKeypressEvents(value, key) {
|
||||
return { value: value, key: key || {} };
|
||||
}
|
||||
|
||||
module.exports = function (rl) {
|
||||
var keypress = fromEvent(rl.input, 'keypress', normalizeKeypressEvents)
|
||||
.pipe(takeUntil(fromEvent(rl, 'close')))
|
||||
// Ignore `enter` key. On the readline, we only care about the `line` event.
|
||||
.pipe(filter(({ key }) => key.name !== 'enter' && key.name !== 'return'));
|
||||
|
||||
return {
|
||||
line: fromEvent(rl, 'line'),
|
||||
keypress: keypress,
|
||||
|
||||
normalizedUpKey: keypress.pipe(
|
||||
filter(
|
||||
({ key }) =>
|
||||
key.name === 'up' || key.name === 'k' || (key.name === 'p' && key.ctrl)
|
||||
),
|
||||
share()
|
||||
),
|
||||
|
||||
normalizedDownKey: keypress.pipe(
|
||||
filter(
|
||||
({ key }) =>
|
||||
key.name === 'down' || key.name === 'j' || (key.name === 'n' && key.ctrl)
|
||||
),
|
||||
share()
|
||||
),
|
||||
|
||||
numberKey: keypress.pipe(
|
||||
filter((e) => e.value && '123456789'.indexOf(e.value) >= 0),
|
||||
map((e) => Number(e.value)),
|
||||
share()
|
||||
),
|
||||
|
||||
spaceKey: keypress.pipe(
|
||||
filter(({ key }) => key && key.name === 'space'),
|
||||
share()
|
||||
),
|
||||
aKey: keypress.pipe(
|
||||
filter(({ key }) => key && key.name === 'a'),
|
||||
share()
|
||||
),
|
||||
iKey: keypress.pipe(
|
||||
filter(({ key }) => key && key.name === 'i'),
|
||||
share()
|
||||
),
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operator/materialize';
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fromArray.js","sources":["../src/observable/fromArray.ts"],"names":[],"mappings":";;;;;AAAA,sDAAiD"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G BC","8":"A B"},B:{"1":"P","2":"Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","8":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 CC tB I u J E F G A B C K L H M N O v w x y z DC EC","8":"6 7 WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","72":"8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB"},D:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P","2":"0 1 2 3 4 5 I u J E F G A B C K L H M N O v w x y z Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","66":"6 7 8 9 AB","72":"BB"},E:{"2":"I u GC zB HC","8":"J E F G A B C K L H IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB","2":"G B C H M fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d OC PC QC RC qB 9B SC rB","66":"N O v w x","72":"y"},G:{"2":"zB TC AC UC VC","8":"F WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"2":"tB I D oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"2":"A B C e qB 9B rB"},L:{"2":"D"},M:{"8":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C","2":"2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"2":"8C"},S:{"1":"9C"}},B:5,C:"HTML Imports"};
|
||||
Reference in New Issue
Block a user