Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
eee146ae8b | |||
ea8ef61c40 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/taskbuffer",
|
"name": "@pushrocks/taskbuffer",
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/taskbuffer",
|
"name": "@pushrocks/taskbuffer",
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "flexible task management. TypeScript ready!",
|
"description": "flexible task management. TypeScript ready!",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -9,7 +9,7 @@ export class TaskDebounced<T = unknown> extends Task {
|
|||||||
constructor(optionsArg: {
|
constructor(optionsArg: {
|
||||||
name: string;
|
name: string;
|
||||||
taskFunction: ITaskFunction;
|
taskFunction: ITaskFunction;
|
||||||
type: 'atMostEvery' | 'afterQuietFor'
|
debounceTimeInMillis: number;
|
||||||
}) {
|
}) {
|
||||||
super({
|
super({
|
||||||
name: optionsArg.name,
|
name: optionsArg.name,
|
||||||
@ -18,7 +18,7 @@ export class TaskDebounced<T = unknown> extends Task {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.taskFunction = optionsArg.taskFunction;
|
this.taskFunction = optionsArg.taskFunction;
|
||||||
this._observableIntake.observable.pipe(plugins.smartrx.rxjs.ops.debounceTime(2000)).subscribe((x) => {
|
this._observableIntake.observable.pipe(plugins.smartrx.rxjs.ops.debounceTime(optionsArg.debounceTimeInMillis)).subscribe((x) => {
|
||||||
this.taskFunction(x);
|
this.taskFunction(x);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user