-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: async reverse iterator for collection (#93247) * fix: add comments and format * feat: update tx types definition * feat: add init and awaiter functions (#96187) * build: update versionnumber chore: update yarn, include tx types feat: add jsdoc * fix: jsdoc with better-docs and no type error * fix: docs path * feat: add waitUntil with retryCount * fix: make resource path configurable --------- Co-authored-by: Björn Nast <bjoern.nast@sinc.de>
- Loading branch information
Showing
11 changed files
with
1,039 additions
and
854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node | ||
{ | ||
|
||
"name": "Node.js", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye", | ||
"runArgs": ["--name", "TX_PROMISES_devcontainer"], | ||
"features": { | ||
"ghcr.io/devcontainers/features/git:1": {} | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ritwickdey.LiveServer" | ||
] | ||
} | ||
} | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "yarn install", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-4.0.2.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"plugins": [ | ||
"node_modules/better-docs/typescript" | ||
], | ||
"recurseDepth": 10, | ||
"source": { | ||
"include": [ | ||
"src" | ||
], | ||
"includePattern": ".+\\.(js|ts)$" | ||
}, | ||
"sourceType": "module", | ||
"tags": { | ||
"allowUnknownTags": true, | ||
"dictionaries": [ | ||
"jsdoc", | ||
"closure" | ||
] | ||
}, | ||
"templates": { | ||
"cleverLinks": false, | ||
"monospaceLinks": false | ||
}, | ||
"opts": { | ||
"destination": "./docs/", | ||
"template": "node_modules/better-docs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { CallbackType } from './CallbackType'; | ||
export { CallbackHelper } from './CallbackHelper'; | ||
export { RequestHelper } from './RequestHelper'; | ||
export { timeout, waitUntil } from './timeout'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* waits a certain amount if milliseconds until promise is resolved | ||
* @param {number} ms | ||
* @returns {Promise<void>} | ||
*/ | ||
export async function timeout(ms) { | ||
return new Promise((resolve, reject) => { | ||
setTimeout(resolve, ms); | ||
}); | ||
} | ||
|
||
/** | ||
* waits in 500ms intervals until condition is true or retryCount is reached. | ||
* @param {function():boolean} condition | ||
* @param {number} [retryCount=-1] set this to prevent infinit loop worst case | ||
* @param {number} [ms=500] time in milliseconds to wait in each intervall | ||
* @returns {Promise<void>} | ||
*/ | ||
export async function waitUntil(condition, retryCount=-1, ms=500){ | ||
return new Promise(async (resolve,reject)=>{ | ||
while(!condition){ | ||
if(retryCount == 0) reject(); | ||
else { | ||
await timeout(ms); | ||
if(retryCount > 0) retryCount--; | ||
} | ||
} | ||
resolve(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.