fix(core): update
This commit is contained in:
parent
cb85deeb3d
commit
5fa7312171
56
package-lock.json
generated
56
package-lock.json
generated
@ -1108,9 +1108,9 @@
|
||||
}
|
||||
},
|
||||
"@gitzone/tstest": {
|
||||
"version": "1.0.41",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.41.tgz",
|
||||
"integrity": "sha512-L9ERXbAC9F6b1um6KCt/kXc6xRcRUt0mZkujA8vRhnVLhFQZ9k3gk/ABD8tQNu1qnPlIH4hjJeVC/CJL/SYgsw==",
|
||||
"version": "1.0.43",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.43.tgz",
|
||||
"integrity": "sha512-wuNBhBDUHHb1TOLQ+QAtUUAhR9Y3uXFR9J0L/KW9DIhh4LPxFdje1tPUGqUbXCWCJ3bt4AWtVBd39K5Z8lSEXQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@gitzone/tsbundle": "^1.0.72",
|
||||
@ -1123,6 +1123,7 @@
|
||||
"@pushrocks/smartlog": "^2.0.19",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartshell": "^2.0.25",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/figures": "^3.0.1",
|
||||
"figures": "^3.0.0"
|
||||
}
|
||||
@ -1241,15 +1242,15 @@
|
||||
"integrity": "sha512-P1xLsuA1+8LQpoWCo2nP2vIQXKGUl5wDWU6CD7xTDZc3uw0He5V/qCPHM5zpIZsS7IuZOxDDpWb7aFveB11tXw=="
|
||||
},
|
||||
"@pushrocks/lik": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.13.tgz",
|
||||
"integrity": "sha512-Nde8rq1DjaDCREKlGGY/zS8g+eFu4zSU2jrbO4DdtYD+9oiauBMz2jzao3fr8401XpNW1Ex8T8FPdjUW8lUMow==",
|
||||
"version": "4.0.14",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-4.0.14.tgz",
|
||||
"integrity": "sha512-S4AMLp+hs1AQ2iCOz5PYReDEfVmfjdf/mf6S5TnAlEhsLU/v3u78xUmMcTPDFotTfuFQr57dGhncHNvljjQ7EQ==",
|
||||
"requires": {
|
||||
"@pushrocks/smartdelay": "^2.0.9",
|
||||
"@pushrocks/smartdelay": "^2.0.10",
|
||||
"@pushrocks/smartmatch": "^1.0.7",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartrx": "^2.0.15",
|
||||
"@pushrocks/smarttime": "^3.0.18",
|
||||
"@pushrocks/smartrx": "^2.0.17",
|
||||
"@pushrocks/smarttime": "^3.0.24",
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"symbol-tree": "^3.2.4"
|
||||
}
|
||||
@ -1590,13 +1591,13 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartrx": {
|
||||
"version": "2.0.17",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrx/-/smartrx-2.0.17.tgz",
|
||||
"integrity": "sha512-jzekKE+Wi/OoRPz/RyBL2LNTQCjb7NizFP3NuST/pl8xQWEu9omGVHNFQEzUDBYQS3D8fSV2tecDf7tKU/kggg==",
|
||||
"version": "2.0.18",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrx/-/smartrx-2.0.18.tgz",
|
||||
"integrity": "sha512-DqUmtS7mONO6bvWEZmSLy4M9hlxNWysMYc7XOZLr50BMaa0HUNYWI1myUFCMNcbUUOxuQNig01XqR1smfIN69g==",
|
||||
"requires": {
|
||||
"@pushrocks/lik": "^4.0.13",
|
||||
"@pushrocks/lik": "^4.0.14",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"rxjs": "^6.5.5"
|
||||
"rxjs": "^6.6.0"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartshell": {
|
||||
@ -4400,21 +4401,6 @@
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "1.2.5",
|
||||
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-1.2.5.tgz",
|
||||
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
|
||||
"dev": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.5",
|
||||
"resolved": "https://verdaccio.lossless.one/mkdirp/-/mkdirp-0.5.5.tgz",
|
||||
"integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/ms/-/ms-2.0.0.tgz",
|
||||
@ -9288,18 +9274,6 @@
|
||||
"make-error": "^1.1.1",
|
||||
"source-map-support": "^0.5.17",
|
||||
"yn": "3.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"source-map-support": {
|
||||
"version": "0.5.19",
|
||||
"resolved": "https://verdaccio.lossless.one/source-map-support/-/source-map-support-0.5.19.tgz",
|
||||
"integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
|
@ -27,17 +27,18 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/taskbuffer#readme",
|
||||
"dependencies": {
|
||||
"@pushrocks/lik": "^4.0.13",
|
||||
"@pushrocks/lik": "^4.0.14",
|
||||
"@pushrocks/smartdelay": "^2.0.10",
|
||||
"@pushrocks/smartlog": "^2.0.35",
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@pushrocks/smartrx": "^2.0.18",
|
||||
"@pushrocks/smarttime": "^3.0.24",
|
||||
"@types/cron": "^1.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.24",
|
||||
"@gitzone/tsbundle": "^1.0.72",
|
||||
"@gitzone/tstest": "^1.0.41",
|
||||
"@gitzone/tstest": "^1.0.43",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.0.22",
|
||||
"tslint": "^6.1.2",
|
||||
|
@ -4,3 +4,4 @@ export { Taskparallel } from './taskbuffer.classes.taskparallel';
|
||||
export { TaskManager } from './taskbuffer.classes.taskmanager';
|
||||
export { TaskOnce } from './taskbuffer.classes.taskonce';
|
||||
export { TaskRunner } from './taskbuffer.classes.taskrunner';
|
||||
export { TaskDebounced } from './taskbuffer.classes.taskdebounced';
|
||||
|
25
ts/taskbuffer.classes.taskdebounced.ts
Normal file
25
ts/taskbuffer.classes.taskdebounced.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import * as plugins from './taskbuffer.plugins';
|
||||
|
||||
import { Task, ITaskFunction } from './taskbuffer.classes.task';
|
||||
|
||||
export class TaskDebounced<T = unknown> extends Task {
|
||||
private _debouncedTaskFunction: ITaskFunction;
|
||||
private _observableIntake = new plugins.smartrx.ObservableIntake<T>();
|
||||
|
||||
constructor(optionsArg: {
|
||||
name: string;
|
||||
taskFunction: ITaskFunction;
|
||||
type: 'atMostEvery' | 'afterQuietFor'
|
||||
}) {
|
||||
super({
|
||||
name: optionsArg.name,
|
||||
taskFunction: async (x: T) => {
|
||||
this._observableIntake.push(x);
|
||||
}
|
||||
});
|
||||
this.taskFunction = optionsArg.taskFunction;
|
||||
this._observableIntake.observable.pipe(plugins.smartrx.rxjs.ops.debounceTime(2000)).subscribe((x) => {
|
||||
this.taskFunction(x);
|
||||
});
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ import * as smartlog from '@pushrocks/smartlog';
|
||||
import * as lik from '@pushrocks/lik';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartdelay from '@pushrocks/smartdelay';
|
||||
import * as smartrx from '@pushrocks/smartrx';
|
||||
import * as smarttime from '@pushrocks/smarttime';
|
||||
|
||||
export { smartlog, lik, smartpromise, smartdelay, smarttime };
|
||||
export { smartlog, lik, smartpromise, smartdelay, smartrx, smarttime };
|
||||
|
Loading…
Reference in New Issue
Block a user