New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rnjs

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rnjs - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

.npmignore

8

dev/src/internal/combinationRNs/combine.ts

@@ -9,4 +9,12 @@ import { RN } from '../RN';

export function every( ...srcs: RN<boolean>[] ): RN<boolean> {
return (new CombineRN( ...srcs )).map( xs => xs.every( x => x ));
}
export function some( ...srcs: RN<boolean>[] ): RN<boolean> {
return (new CombineRN( ...srcs )).map( xs => xs.some( x => x ));
}
class CombineRN<T extends RN<any>[]> extends RN<Unwrap<T>> {

@@ -13,0 +21,0 @@

6

dev/src/internal/mod.ts

@@ -5,3 +5,3 @@ // This file is created to avoid circular reference between RN and operators.

export * from './operators/withInitialValue';
export * from './operators/auditTime';
export * from './operators/debounce';

@@ -14,8 +14,10 @@ export * from './operators/delay';

export * from './operators/scan';
export * from './operators/skip';
export * from './operators/skipAlreadyAppeared';
export * from './operators/skipUnchanged';
export * from './operators/skip';
export * from './operators/startWith';
export * from './operators/switchMap';
export * from './operators/take';
export * from './operators/throttle';
export * from './operators/withInitialValue';
export * from './operators/withLatest';

@@ -10,3 +10,3 @@ /* removed in prod */ import { RN } from '../mod';

class DebounceRN<T> extends RN<T> {
private time: number;
private readonly time: number;
private timerId: any;

@@ -13,0 +13,0 @@

@@ -10,3 +10,3 @@ /* removed in prod */ import { RN } from '../mod';

class DelayRN<T> extends RN<T> {
private time: number;
private readonly time: number;
private timerId: any;

@@ -13,0 +13,0 @@

@@ -14,3 +14,3 @@ /* removed in prod */ import { RN } from '../mod';

class FilterRN<T> extends RN<T> {
private predicate: (srcValue: T, srcIndex: number, index: number) => boolean;
private readonly predicate: (srcValue: T, srcIndex: number, index: number) => boolean;

@@ -17,0 +17,0 @@ constructor(

@@ -16,3 +16,3 @@ /* removed in prod */ import { RN } from '../mod';

private subscriptions: Subscription[];
private fn: (srcValue: T, srcIndex: number, index: number) => RN<U>;
private readonly fn: (srcValue: T, srcIndex: number, index: number) => RN<U>;

@@ -19,0 +19,0 @@ constructor(

@@ -9,5 +9,11 @@ /* removed in prod */ import { RN } from '../mod';

export const mapTo = <T, U>( value: U ): Operator<T, U> =>
export const mapTo = <T, U>(value: U): Operator<T, U> =>
(( src: RN<T> ) => new MapRN<T, U>( src, () => value ));
export const valueIs = <T>(value: T): Operator<T, boolean> =>
(( src: RN<T> ) => new MapRN<T, boolean>( src, x => x === value ));
export const valueIsNot = <T>(value: T): Operator<T, boolean> =>
(( src: RN<T> ) => new MapRN<T, boolean>( src, x => x !== value ));
export const pluck = <T, K extends keyof T>( member: K ): Operator<T, T[K]> =>

@@ -19,4 +25,6 @@ (( src: RN<T> ) => new MapRN<T, T[K]>( src, value => value[ member ] ));

class MapRN<T, U> extends RN<U> {
private fn: (srcValue: T, srcIndex: number, index: number) => U;
private readonly fn: (srcValue: T, srcIndex: number, index: number) => U;

@@ -23,0 +31,0 @@ constructor(

@@ -15,3 +15,3 @@ /* removed in prod */ import { RN } from '../mod';

private scanState: U;
private fn: (state: U, srcValue: T, srcIndex: number, index: number) => U;
private readonly fn: (state: U, srcValue: T, srcIndex: number, index: number) => U;

@@ -18,0 +18,0 @@ constructor(

@@ -24,3 +24,3 @@ /* removed in prod */ import { RN } from '../mod';

class SkipWhileRN<T> extends RN<T> {
private predicate: (srcValue: T, srcIndex: number, index: number) => boolean;
private readonly predicate: (srcValue: T, srcIndex: number, index: number) => boolean;

@@ -27,0 +27,0 @@ constructor(

@@ -11,3 +11,3 @@ /* removed in prod */ import { RN } from '../mod';

class SkipAlreadyAppearedRN<T, K extends keyof T> extends RN<T> {
private key?: K;
private readonly key?: K;
private appeared: Set<T|T[K]>;

@@ -14,0 +14,0 @@

@@ -12,3 +12,3 @@ /* removed in prod */ import { RN } from '../mod';

class SkipUnchangedRN<T> extends RN<T> {
private eq: (a: T, b: T) => boolean = ((a, b) => a === b);
private readonly eq: (a: T, b: T) => boolean = ((a, b) => a === b);

@@ -15,0 +15,0 @@ constructor( src: RN<T>, eq: (a: T, b: T) => boolean = ((a, b) => a === b) ) {

@@ -16,3 +16,3 @@ /* removed in prod */ import { RN } from '../mod';

private subscription: Subscription;
private fn: (srcValue: T, srcIndex: number, index: number) => RN<U>;
private readonly fn: (srcValue: T, srcIndex: number, index: number) => RN<U>;

@@ -19,0 +19,0 @@ constructor(

@@ -16,3 +16,3 @@ /* removed in prod */ import { RN } from '../mod';

class TakeWhileRN<T> extends RN<T> {
private predicate: (srcValue: T, srcIndex: number, index: number) => boolean;
private readonly predicate: (srcValue: T, srcIndex: number, index: number) => boolean;

@@ -19,0 +19,0 @@ constructor(

@@ -10,3 +10,3 @@ /* removed in prod */ import { RN } from '../mod';

class ThrottleRN<T> extends RN<T> {
private time: number;
private readonly time: number;
private lastFireTime: number = 0;

@@ -13,0 +13,0 @@

@@ -12,4 +12,4 @@ /* removed in prod */ import { RN } from '../mod';

constructor(
src: RN<T>,
initialValue: T
src: RN<T>,
initialValue: T
) {

@@ -16,0 +16,0 @@ super( initialValue, [src] );

@@ -11,3 +11,3 @@ /* removed in prod */ import { RN } from '../mod';

class WithLatestRN<T, U> extends RN<[T, U]> {
private src2: RN<U>;
private readonly src2: RN<U>;

@@ -14,0 +14,0 @@ constructor( src: RN<T>, src2: RN<U> ) {

@@ -9,2 +9,3 @@ import { RNId } from './types/RNId';

/* removed in prod */ import {
/* removed in prod */ auditTime,
/* removed in prod */ debounce,

@@ -16,10 +17,13 @@ /* removed in prod */ delay,

/* removed in prod */ mapTo,
/* removed in prod */ valueIs,
/* removed in prod */ valueIsNot,
/* removed in prod */ pluck,
/* removed in prod */ withTimestamp,
/* removed in prod */ pairwise,
/* removed in prod */ pluck,
/* removed in prod */ scan,
/* removed in prod */ skip,
/* removed in prod */ skipWhile,
/* removed in prod */ skipAlreadyAppeared,
/* removed in prod */ skipUnchanged,
/* removed in prod */ skipWhile,
/* removed in prod */ withInitialValue,
/* removed in prod */ startWith,
/* removed in prod */ switchMap,

@@ -29,4 +33,4 @@ /* removed in prod */ take,

/* removed in prod */ throttle,
/* removed in prod */ withInitialValue,
/* removed in prod */ withLatest,
/* removed in prod */ withTimestamp,
/* removed in prod */ } from './mod';

@@ -353,2 +357,15 @@

listenWhile(
predicate: (srcValue: T, srcIndex: number, index: number) => boolean,
runWithFirstValue: boolean = true,
onFire: (v: T) => void,
onError?: (e?: any) => void,
onComplete?: (v: T) => void,
): Subscription {
return this.takeWhile( predicate )
.listen( runWithFirstValue, onFire, onError, onComplete );
}
// get the next value emitted right after this method is called

@@ -447,4 +464,4 @@ once(): Promise<T> {

withInitialValue( initialValue: T ): RN<T> {
return withInitialValue( initialValue )( this );
auditTime( time: number ): RN<T> {
return auditTime<T>( time )( this );
}

@@ -483,6 +500,10 @@

pairwise( initialPrevValue?: T ): RN<[T, T]> {
return pairwise<T>( initialPrevValue )( this );
valueIs( value: T ): RN<boolean> {
return valueIs<T>( value )( this );
}
valueIsNot( value: T ): RN<boolean> {
return valueIsNot<T>( value )( this );
}
pluck<K extends keyof T>( member: K ): RN<T[K]> {

@@ -492,2 +513,10 @@ return pluck<T, K>( member )( this );

withTimestamp(): RN<[T, number]> {
return withTimestamp<T>()( this );
}
pairwise( initialPrevValue?: T ): RN<[T, T]> {
return pairwise<T>( initialPrevValue )( this );
}
scan<U>(

@@ -504,2 +533,9 @@ initialValue: U,

skipWhile(
initialValue: T,
predicate: (srcValue: T, srcIndex: number, index: number) => boolean,
): RN<T> {
return skipWhile<T>( initialValue, predicate )( this );
}
skipAlreadyAppeared<K extends keyof T>( key?: K ): RN<T> {

@@ -513,7 +549,4 @@ return skipAlreadyAppeared<T, K>( key )( this );

skipWhile(
initialValue: T,
predicate: (srcValue: T, srcIndex: number, index: number) => boolean,
): RN<T> {
return skipWhile<T>( initialValue, predicate )( this );
startWith( initialValue: T ): RN<T> {
return startWith( initialValue )( this );
}

@@ -541,2 +574,6 @@

withInitialValue( initialValue: T ): RN<T> {
return withInitialValue( initialValue )( this );
}
withLatest<U>( src: RN<U> ): RN<[T, U]> {

@@ -546,6 +583,2 @@ return withLatest<T, U>( src )( this );

withTimestamp(): RN<[T, number]> {
return withTimestamp<T>()( this );
}
}

@@ -0,0 +0,0 @@ import { RN } from '../RN';

export {
auditTime,
debounce,

@@ -8,16 +9,19 @@ delay,

mapTo,
valueIs,
valueIsNot,
withTimestamp,
pluck,
pairwise,
pluck,
scan,
skipAlreadyAppeared,
skipUnchanged,
skip,
skipWhile,
startWith,
switchMap,
take,
takeWhile,
throttle,
withLatest,
withInitialValue,
withTimestamp,
throttle,
skipAlreadyAppeared,
} from './internal/mod';
export { RN } from './internal/mod';
export { combine } from './internal/combinationRNs/combine';
export { merge } from './internal/combinationRNs/merge';
export { fromEvent } from './internal/sourceRNs/fromEvent';
export { fromPromise } from './internal/sourceRNs/fromPromise';
export { fromObservable } from './internal/sourceRNs/fromObservable';
export { interval } from './internal/sourceRNs/interval';
export { manual } from './internal/sourceRNs/manual';
export { constant, of } from './internal/sourceRNs/constant';
export { combine, every, some } from './internal/combinationRNs/combine';
export { merge } from './internal/combinationRNs/merge';
export { fromEvent } from './internal/sourceRNs/fromEvent';
export { fromPromise } from './internal/sourceRNs/fromPromise';
export { fromObservable } from './internal/sourceRNs/fromObservable';
export { interval } from './internal/sourceRNs/interval';
export { manual } from './internal/sourceRNs/manual';
export { constant, of } from './internal/sourceRNs/constant';

@@ -1,23 +0,51 @@

import { RN,
import {
// RN,
interval,
every,
some,
combine,
manual,
merge,
fromObservable,
// manual,
// merge,
// fromObservable,
} from './RN';
// import { combine } from '../../src/RN';
import {
map,
debounce,
filter,
scan,
} from './operators';
// import {
// map,
// debounce,
// filter,
// scan,
// } from './operators';
const counter = interval( 500, true );
const a = counter.map( x => x % 2 === 0 );
const b = counter.map( x => x % 3 === 0 );
counter.listen( true, console.log );
some(a, b).listen( true, console.log );
// const b = a.startWith(999);
// const c = a.withInitialValue(888);
// a.listen( false, console.log );
// b.listen( false, console.log );
// c.listen( false, console.log );
// a.start();
const a = interval( 500, true );
const b = a.scan( 0, (s, v) => s + v );
a.listen( true, console.log );
b.listen( true, console.log );
/*
0
999
0
0
1
1
2
2
3
3
a : 0 |0---1---2---3---4---0---0-...
b : 999 |999-1---1---1---1---1---1-...
*/
// const a = interval( 1000, true ).take( 5 );

@@ -24,0 +52,0 @@ // a.listen( true, console.log );

@@ -0,0 +0,0 @@ export {

@@ -6,3 +6,3 @@ {

"name": "rnjs",
"version": "1.0.15",
"version": "1.0.16",
"description": "Reactive Programming Library for TypeScript/JavaScript",

@@ -9,0 +9,0 @@ "main": "dist/index.js",

@@ -126,2 +126,3 @@ # RN

| manual | BehaviorSubject |
| - | ... |

@@ -136,2 +137,3 @@ * Combination methods

| - | zip |
| - | ... |

@@ -143,2 +145,3 @@

| ------------------- | -------------------- |
| auditTime | auditTime |
| delay | delay |

@@ -157,2 +160,3 @@ | debounce | debounceTime |

| skipWhile | skipWhile |
| startWith | startWith |
| switchMap | switchMap |

@@ -164,4 +168,4 @@ | take | take |

| withTimestamp | timestamp |
| - | startWith |
| withInitialValue | - |
| - | ... |

@@ -673,2 +677,40 @@

* valueIs, valueIsNot
```ts
const a = interval( 500, true );
const b = a.valueIs(3);
combine(a, b).listen( true, console.log )
/*
[ 0, false ]
[ 1, false ]
[ 2, false ]
[ 3, true ]
[ 4, false ]
[ 5, false ]
...
*/
```
```ts
const a = interval( 500, true );
const b = a.valueIsNot(3);
combine(a, b).listen( true, console.log )
/*
[ 0, true ]
[ 1, true ]
[ 2, true ]
[ 3, false ]
[ 4, true ]
[ 5, true ]
...
*/
```
* switchMap

@@ -749,2 +791,72 @@

* every, some
```ts
const counter = interval( 500, true );
const a = counter.map( x => x % 2 === 0 );
const b = counter.map( x => x % 3 === 0 );
counter.listen( true, console.log );
every(a, b).listen( true, console.log );
/*
0
true
1
false
2
false
3
false
4
false
5
false
6
true
7
false
counter : 0 |0---1---2---3---4---5---6---7---...
a : T |T---F---T---F---T---F---T---F---...
b : T |T---F---F---T---F---F---T---F---...
every : T |T---F---F---F---F---F---T---F---...
```
```ts
const counter = interval( 500, true );
const a = counter.map( x => x % 2 === 0 );
const b = counter.map( x => x % 3 === 0 );
counter.listen( true, console.log );
some(a, b).listen( true, console.log );
/*
0
true
1
false
2
true
3
true
4
true
5
false
6
true
7
false
...
counter : 0 |0---1---2---3---4---5---6---7---...
a : T |T---F---T---F---T---F---T---F---...
b : T |T---F---F---T---F---F---T---F---...
some : T |T---F---T---T---T---F---T---F---...
```
* toPromise

@@ -751,0 +863,0 @@

@@ -9,4 +9,12 @@ import { RN } from '../RN';

export function every( ...srcs: RN<boolean>[] ): RN<boolean> {
return (new CombineRN( ...srcs )).map( xs => xs.every( x => x ));
}
export function some( ...srcs: RN<boolean>[] ): RN<boolean> {
return (new CombineRN( ...srcs )).map( xs => xs.some( x => x ));
}
class CombineRN<T extends RN<any>[]> extends RN<Unwrap<T>> {

@@ -13,0 +21,0 @@

@@ -328,2 +328,15 @@ import { RNId } from './types/RNId';

listenWhile(
predicate: (srcValue: T, srcIndex: number, index: number) => boolean,
runWithFirstValue: boolean = true,
onFire: (v: T) => void,
onError?: (e?: any) => void,
onComplete?: (v: T) => void,
): Subscription {
return this.takeWhile( predicate )
.listen( runWithFirstValue, onFire, onError, onComplete );
}
// get the next value emitted right after this method is called

@@ -422,4 +435,4 @@ once(): Promise<T> {

withInitialValue( initialValue: T ): RN<T> {
return withInitialValue( initialValue )( this );
auditTime( time: number ): RN<T> {
return auditTime<T>( time )( this );
}

@@ -458,6 +471,10 @@

pairwise( initialPrevValue?: T ): RN<[T, T]> {
return pairwise<T>( initialPrevValue )( this );
valueIs( value: T ): RN<boolean> {
return valueIs<T>( value )( this );
}
valueIsNot( value: T ): RN<boolean> {
return valueIsNot<T>( value )( this );
}
pluck<K extends keyof T>( member: K ): RN<T[K]> {

@@ -467,2 +484,10 @@ return pluck<T, K>( member )( this );

withTimestamp(): RN<[T, number]> {
return withTimestamp<T>()( this );
}
pairwise( initialPrevValue?: T ): RN<[T, T]> {
return pairwise<T>( initialPrevValue )( this );
}
scan<U>(

@@ -479,2 +504,9 @@ initialValue: U,

skipWhile(
initialValue: T,
predicate: (srcValue: T, srcIndex: number, index: number) => boolean,
): RN<T> {
return skipWhile<T>( initialValue, predicate )( this );
}
skipAlreadyAppeared<K extends keyof T>( key?: K ): RN<T> {

@@ -488,7 +520,4 @@ return skipAlreadyAppeared<T, K>( key )( this );

skipWhile(
initialValue: T,
predicate: (srcValue: T, srcIndex: number, index: number) => boolean,
): RN<T> {
return skipWhile<T>( initialValue, predicate )( this );
startWith( initialValue: T ): RN<T> {
return startWith( initialValue )( this );
}

@@ -516,2 +545,6 @@

withInitialValue( initialValue: T ): RN<T> {
return withInitialValue( initialValue )( this );
}
withLatest<U>( src: RN<U> ): RN<[T, U]> {

@@ -521,6 +554,33 @@ return withLatest<T, U>( src )( this );

withTimestamp(): RN<[T, number]> {
return withTimestamp<T>()( this );
}
export const auditTime = <T>( time: number ): Operator<T, T> =>
(( src: RN<T> ) => new AuditTimeRN<T>( src, time ));
class AuditTimeRN<T> extends RN<T> {
private readonly time: number;
private timerId: any;
private timerIsRunning: boolean = false;
constructor( src: RN<T>, time: number ) {
super( src.value, [src] );
this.time = time;
}
protected fire() {
if ( !this.timerIsRunning ) {
this.timerIsRunning = true;
this.timerId = setTimeout(() => {
this.fireWith( this.parents[0].value );
this.timerIsRunning = false;
}, this.time );
}
}
complete() {
super.complete();
clearTimeout( this.timerId );
}
}

@@ -534,3 +594,3 @@

class DebounceRN<T> extends RN<T> {
private time: number;
private readonly time: number;
private timerId: any;

@@ -563,3 +623,3 @@

class DelayRN<T> extends RN<T> {
private time: number;
private readonly time: number;
private timerId: any;

@@ -594,3 +654,3 @@

class FilterRN<T> extends RN<T> {
private predicate: (srcValue: T, srcIndex: number, index: number) => boolean;
private readonly predicate: (srcValue: T, srcIndex: number, index: number) => boolean;

@@ -626,3 +686,3 @@ constructor(

private subscriptions: Subscription[];
private fn: (srcValue: T, srcIndex: number, index: number) => RN<U>;
private readonly fn: (srcValue: T, srcIndex: number, index: number) => RN<U>;

@@ -658,5 +718,11 @@ constructor(

export const mapTo = <T, U>( value: U ): Operator<T, U> =>
export const mapTo = <T, U>(value: U): Operator<T, U> =>
(( src: RN<T> ) => new MapRN<T, U>( src, () => value ));
export const valueIs = <T>(value: T): Operator<T, boolean> =>
(( src: RN<T> ) => new MapRN<T, boolean>( src, x => x === value ));
export const valueIsNot = <T>(value: T): Operator<T, boolean> =>
(( src: RN<T> ) => new MapRN<T, boolean>( src, x => x !== value ));
export const pluck = <T, K extends keyof T>( member: K ): Operator<T, T[K]> =>

@@ -668,4 +734,6 @@ (( src: RN<T> ) => new MapRN<T, T[K]>( src, value => value[ member ] ));

class MapRN<T, U> extends RN<U> {
private fn: (srcValue: T, srcIndex: number, index: number) => U;
private readonly fn: (srcValue: T, srcIndex: number, index: number) => U;

@@ -719,3 +787,3 @@ constructor(

private scanState: U;
private fn: (state: U, srcValue: T, srcIndex: number, index: number) => U;
private readonly fn: (state: U, srcValue: T, srcIndex: number, index: number) => U;

@@ -760,3 +828,3 @@ constructor(

class SkipWhileRN<T> extends RN<T> {
private predicate: (srcValue: T, srcIndex: number, index: number) => boolean;
private readonly predicate: (srcValue: T, srcIndex: number, index: number) => boolean;

@@ -788,3 +856,3 @@ constructor(

class SkipAlreadyAppearedRN<T, K extends keyof T> extends RN<T> {
private key?: K;
private readonly key?: K;
private appeared: Set<T|T[K]>;

@@ -822,3 +890,3 @@

class SkipUnchangedRN<T> extends RN<T> {
private eq: (a: T, b: T) => boolean = ((a, b) => a === b);
private readonly eq: (a: T, b: T) => boolean = ((a, b) => a === b);

@@ -842,2 +910,24 @@ constructor( src: RN<T>, eq: (a: T, b: T) => boolean = ((a, b) => a === b) ) {

export const startWith = <T>( initialValue: T ): Operator<T, T> =>
(( src: RN<T> ) => new StartWithRN<T>( src, initialValue ));
class StartWithRN<T> extends RN<T> {
constructor(
src: RN<T>,
initialValue: T
) {
super( initialValue, [src] );
this.fireWith( initialValue );
}
protected fire() {
const src = this.parents[0];
// note: 'this.index' is not updated yet (will be updated in this.fireWith())
this.fireWith( src.value );
}
}
export const switchMap = <T, U>(

@@ -852,3 +942,3 @@ fn: (srcValue: T, srcIndex: number, index: number) => RN<U>

private subscription: Subscription;
private fn: (srcValue: T, srcIndex: number, index: number) => RN<U>;
private readonly fn: (srcValue: T, srcIndex: number, index: number) => RN<U>;

@@ -891,3 +981,3 @@ constructor(

class TakeWhileRN<T> extends RN<T> {
private predicate: (srcValue: T, srcIndex: number, index: number) => boolean;
private readonly predicate: (srcValue: T, srcIndex: number, index: number) => boolean;

@@ -920,3 +1010,3 @@ constructor(

class ThrottleRN<T> extends RN<T> {
private time: number;
private readonly time: number;
private lastFireTime: number = 0;

@@ -945,4 +1035,4 @@

constructor(
src: RN<T>,
initialValue: T
src: RN<T>,
initialValue: T
) {

@@ -966,3 +1056,3 @@ super( initialValue, [src] );

class WithLatestRN<T, U> extends RN<[T, U]> {
private src2: RN<U>;
private readonly src2: RN<U>;

@@ -969,0 +1059,0 @@ constructor( src: RN<T>, src2: RN<U> ) {

@@ -0,0 +0,0 @@ import { RN } from '../RN';

export {
auditTime,
debounce,

@@ -8,16 +9,19 @@ delay,

mapTo,
valueIs,
valueIsNot,
withTimestamp,
pluck,
pairwise,
pluck,
scan,
skipAlreadyAppeared,
skipUnchanged,
skip,
skipWhile,
startWith,
switchMap,
take,
takeWhile,
throttle,
withLatest,
withInitialValue,
withTimestamp,
throttle,
skipAlreadyAppeared,
} from './internal/RN';
export { RN } from './internal/RN';
export { combine } from './internal/combinationRNs/combine';
export { merge } from './internal/combinationRNs/merge';
export { fromEvent } from './internal/sourceRNs/fromEvent';
export { fromPromise } from './internal/sourceRNs/fromPromise';
export { fromObservable } from './internal/sourceRNs/fromObservable';
export { interval } from './internal/sourceRNs/interval';
export { manual } from './internal/sourceRNs/manual';
export { constant, of } from './internal/sourceRNs/constant';
export { combine, every, some } from './internal/combinationRNs/combine';
export { merge } from './internal/combinationRNs/merge';
export { fromEvent } from './internal/sourceRNs/fromEvent';
export { fromPromise } from './internal/sourceRNs/fromPromise';
export { fromObservable } from './internal/sourceRNs/fromObservable';
export { interval } from './internal/sourceRNs/interval';
export { manual } from './internal/sourceRNs/manual';
export { constant, of } from './internal/sourceRNs/constant';

@@ -1,23 +0,51 @@

import { RN,
import {
// RN,
interval,
every,
some,
combine,
manual,
merge,
fromObservable,
// manual,
// merge,
// fromObservable,
} from './RN';
// import { combine } from '../../src/RN';
import {
map,
debounce,
filter,
scan,
} from './operators';
// import {
// map,
// debounce,
// filter,
// scan,
// } from './operators';
const counter = interval( 500, true );
const a = counter.map( x => x % 2 === 0 );
const b = counter.map( x => x % 3 === 0 );
counter.listen( true, console.log );
some(a, b).listen( true, console.log );
// const b = a.startWith(999);
// const c = a.withInitialValue(888);
// a.listen( false, console.log );
// b.listen( false, console.log );
// c.listen( false, console.log );
// a.start();
const a = interval( 500, true );
const b = a.scan( 0, (s, v) => s + v );
a.listen( true, console.log );
b.listen( true, console.log );
/*
0
999
0
0
1
1
2
2
3
3
a : 0 |0---1---2---3---4---0---0-...
b : 999 |999-1---1---1---1---1---1-...
*/
// const a = interval( 1000, true ).take( 5 );

@@ -24,0 +52,0 @@ // a.listen( true, console.log );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc