Compare commits

..

11 Commits

Author SHA1 Message Date
1f1e0e4ee1 4.0.3 2023-07-10 23:12:01 +02:00
139d4cb56d fix(core): update 2023-07-10 23:12:00 +02:00
8038e54f53 switch to new org scheme 2023-07-10 10:17:29 +02:00
37284da2cc 4.0.2 2023-04-17 21:01:18 +02:00
b0772e2372 fix(core): update 2023-04-17 21:01:18 +02:00
f3eac4a5f7 4.0.1 2023-04-17 21:00:26 +02:00
fde31ec25d fix(core): update 2023-04-17 21:00:25 +02:00
810b299caa 4.0.0 2023-04-04 20:54:35 +02:00
c71ac16090 BREAKING CHANGE(core): switch to esm 2023-04-04 20:54:35 +02:00
91b52982c0 3.1.9 2023-04-04 20:35:54 +02:00
97f8327fe9 fix(core): update 2023-04-04 20:35:54 +02:00
7 changed files with 429 additions and 191 deletions

View File

@ -7,10 +7,10 @@
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "push.rocks",
"gitrepo": "smartpromise", "gitrepo": "smartpromise",
"description": "simple promises and Deferred constructs", "description": "simple promises and Deferred constructs",
"npmPackagename": "@pushrocks/smartpromise", "npmPackagename": "@push.rocks/smartpromise",
"license": "MIT" "license": "MIT"
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"name": "@pushrocks/smartpromise", "name": "@push.rocks/smartpromise",
"private": false, "private": false,
"version": "3.1.8", "version": "4.0.3",
"description": "simple promises and Deferred constructs", "description": "simple promises and Deferred constructs",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
@ -21,11 +21,11 @@
}, },
"homepage": "https://gitlab.com/pushrocks/smartq#README", "homepage": "https://gitlab.com/pushrocks/smartq#README",
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.65", "@gitzone/tsbuild": "^2.1.66",
"@gitzone/tsrun": "^1.2.39", "@gitzone/tsrun": "^1.2.42",
"@gitzone/tstest": "^1.0.74", "@gitzone/tstest": "^1.0.74",
"@pushrocks/tapbundle": "^5.0.4", "@pushrocks/tapbundle": "^5.0.8",
"@types/node": "^18.15.11" "@types/node": "^20.4.1"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

585
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @pushrocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartpromise', name: '@push.rocks/smartpromise',
version: '3.1.8', version: '4.0.3',
description: 'simple promises and Deferred constructs' description: 'simple promises and Deferred constructs'
} }

View File

@ -1,6 +1,6 @@
import { defer } from './smartpromise.classes.deferred.js'; import { defer } from './smartpromise.classes.deferred.js';
export * from './smartpromise.classes.commulativepromise.js'; export * from './smartpromise.classes.cumulativedeferred.js';
export * from './smartpromise.classes.deferred.js'; export * from './smartpromise.classes.deferred.js';

View File

@ -1,6 +1,6 @@
import { defer } from "./smartpromise.classes.deferred.js"; import { defer } from "./smartpromise.classes.deferred.js";
export class ComulativeDeferred { export class CumulativeDeferred {
private accumulatedPromises: Promise<any>[] = []; private accumulatedPromises: Promise<any>[] = [];
private deferred = defer(); private deferred = defer();
public promise = this.deferred.promise; public promise = this.deferred.promise;
@ -21,6 +21,6 @@ export class ComulativeDeferred {
} }
export const commulativeDefer = () => { export const cumulativeDefer = () => {
return new ComulativeDeferred(); return new CumulativeDeferred();
} }

View File

@ -13,6 +13,13 @@ export class Deferred<T> {
public resolve: IResolve<T>; public resolve: IResolve<T>;
public reject: IReject; public reject: IReject;
public status: TDeferredStatus; public status: TDeferredStatus;
public claimed = false;
public claim() {
if (this.claimed) {
throw new Error('Deferred already claimed');
}
this.claimed = true;
}
public startedAt: number; public startedAt: number;
public stoppedAt: number; public stoppedAt: number;