fix(core): update
This commit is contained in:
parent
037e33caee
commit
610c1d6beb
7948
package-lock.json
generated
7948
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@ -13,18 +13,18 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.24",
|
||||||
"@gitzone/tsbundle": "^1.0.69",
|
"@gitzone/tsbundle": "^1.0.72",
|
||||||
"@gitzone/tsrun": "^1.2.12",
|
"@gitzone/tsrun": "^1.2.12",
|
||||||
"@gitzone/tstest": "^1.0.33",
|
"@gitzone/tstest": "^1.0.43",
|
||||||
"@pushrocks/tapbundle": "^3.2.1",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
"@types/node": "^14.0.14",
|
"@types/node": "^14.0.22",
|
||||||
"tslint": "^6.1.2",
|
"tslint": "^6.1.2",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^4.0.13",
|
"@pushrocks/lik": "^4.0.14",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"rxjs": "^6.5.5"
|
"rxjs": "^6.6.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
@ -37,5 +37,8 @@
|
|||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -7,9 +7,9 @@ tap.test('should create a valid instance of observableinstake', async () => {
|
|||||||
expect(testObservableIntake).to.be.instanceOf(smartrx.ObservableIntake);
|
expect(testObservableIntake).to.be.instanceOf(smartrx.ObservableIntake);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('expect testObserservableIntake to push things', async tools => {
|
tap.test('expect testObserservableIntake to push things', async (tools) => {
|
||||||
const testObserservableIntake = new smartrx.ObservableIntake();
|
const testObserservableIntake = new smartrx.ObservableIntake();
|
||||||
testObserservableIntake.subscribe(value => {
|
testObserservableIntake.subscribe((value) => {
|
||||||
console.log(value);
|
console.log(value);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -19,13 +19,13 @@ tap.test('expect testObserservableIntake to push things', async tools => {
|
|||||||
await testObserservableIntake.completed;
|
await testObserservableIntake.completed;
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('expect testObserservableIntake to push things', async tools => {
|
tap.test('expect testObserservableIntake to push things', async (tools) => {
|
||||||
const testObserservableIntake = new smartrx.ObservableIntake();
|
const testObserservableIntake = new smartrx.ObservableIntake();
|
||||||
testObserservableIntake.push('hi');
|
testObserservableIntake.push('hi');
|
||||||
testObserservableIntake.push('wow');
|
testObserservableIntake.push('wow');
|
||||||
testObserservableIntake.makeBuffered();
|
testObserservableIntake.makeBuffered();
|
||||||
testObserservableIntake.push('jo');
|
testObserservableIntake.push('jo');
|
||||||
testObserservableIntake.subscribe(value => {
|
testObserservableIntake.subscribe((value) => {
|
||||||
console.log(value);
|
console.log(value);
|
||||||
testObserservableIntake.signalComplete();
|
testObserservableIntake.signalComplete();
|
||||||
});
|
});
|
||||||
|
@ -22,7 +22,7 @@ tap.test('should accept a new emitter', async () => {
|
|||||||
let done = smartpromise.defer();
|
let done = smartpromise.defer();
|
||||||
testEmitter = new events.EventEmitter();
|
testEmitter = new events.EventEmitter();
|
||||||
testObservable1 = testObservablemap.getObservableForEmitterEvent(testEmitter, 'event1');
|
testObservable1 = testObservablemap.getObservableForEmitterEvent(testEmitter, 'event1');
|
||||||
testObservable1.subscribe(x => {
|
testObservable1.subscribe((x) => {
|
||||||
done.resolve();
|
done.resolve();
|
||||||
});
|
});
|
||||||
testObservable2 = testObservablemap.getObservableForEmitterEvent(testEmitter, 'event1');
|
testObservable2 = testObservablemap.getObservableForEmitterEvent(testEmitter, 'event1');
|
||||||
|
@ -8,19 +8,19 @@ export class ObservableIntake<T> {
|
|||||||
public completed: Promise<void>;
|
public completed: Promise<void>;
|
||||||
private completedDeffered: plugins.smartpromise.Deferred<void>;
|
private completedDeffered: plugins.smartpromise.Deferred<void>;
|
||||||
private observableFunctions: any = {
|
private observableFunctions: any = {
|
||||||
next: payloadArg => {
|
next: (payloadArg) => {
|
||||||
// nothing
|
// nothing
|
||||||
},
|
},
|
||||||
complete: payloadArg => {
|
complete: (payloadArg) => {
|
||||||
// nothing
|
// nothing
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
private generator = null;
|
private generator = null;
|
||||||
private buffered = false;
|
private buffered = false;
|
||||||
private payloadBuffer = [];
|
private payloadBuffer = [];
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.observable = plugins.rxjs.Observable.create(observerArg => {
|
this.observable = plugins.rxjs.Observable.create((observerArg) => {
|
||||||
this.observableFunctions.next = (...args) => {
|
this.observableFunctions.next = (...args) => {
|
||||||
return observerArg.next(...args);
|
return observerArg.next(...args);
|
||||||
};
|
};
|
||||||
|
@ -24,7 +24,7 @@ export class Observablemap {
|
|||||||
* In case event has been registered before the same observable is returned.
|
* In case event has been registered before the same observable is returned.
|
||||||
*/
|
*/
|
||||||
public getObservableForEmitterEvent<T>(emitterArg: IEventEmitter<T>, eventArg: string) {
|
public getObservableForEmitterEvent<T>(emitterArg: IEventEmitter<T>, eventArg: string) {
|
||||||
const existingBundle = this.observableEmitterBundleObjectmap.find(bundleArg => {
|
const existingBundle = this.observableEmitterBundleObjectmap.find((bundleArg) => {
|
||||||
return bundleArg.emitter === emitterArg && bundleArg.event === eventArg;
|
return bundleArg.emitter === emitterArg && bundleArg.event === eventArg;
|
||||||
});
|
});
|
||||||
if (existingBundle) {
|
if (existingBundle) {
|
||||||
@ -34,7 +34,7 @@ export class Observablemap {
|
|||||||
this.observableEmitterBundleObjectmap.add({
|
this.observableEmitterBundleObjectmap.add({
|
||||||
observable: emitterObservable,
|
observable: emitterObservable,
|
||||||
emitter: emitterArg,
|
emitter: emitterArg,
|
||||||
event: eventArg
|
event: eventArg,
|
||||||
});
|
});
|
||||||
return emitterObservable;
|
return emitterObservable;
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
export { Observable, Subject, fromEvent, ReplaySubject } from 'rxjs';
|
export { Observable, Subject, fromEvent, ReplaySubject } from 'rxjs';
|
||||||
|
|
||||||
import { startWith, takeUntil, map } from 'rxjs/operators';
|
import { startWith, takeUntil, map, debounce, debounceTime } from 'rxjs/operators';
|
||||||
|
|
||||||
export const ops = {
|
export const ops = {
|
||||||
|
debounce,
|
||||||
|
debounceTime,
|
||||||
|
map,
|
||||||
startWith,
|
startWith,
|
||||||
takeUntil,
|
takeUntil,
|
||||||
map
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user