![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@hasezoey/interval-promise-ts
Advanced tools
its a rewrite to TS Original by Andy Fleming
using my(hasezoey) TS config & lint options
This library provides a simple mechanism for running a promise with a given amount of time between executions.
Simple example using async-await
const interval = require('interval-promise')
// Run a function 10 times with 1 second between each iteration
const id = interval.interval(async () => {
await someOtherPromiseReturningFunction()
await another()
}, 1000, {iterations: 10})
// clear it
await clearInterval(id);
import { interval, clearInterval } from "interval-promise";
// Run a function 10 times with 1 second between each iteration
const id: string = interval(async () => {
await someOtherPromiseReturningFunction()
await another()
}, 1000, {iterations: 10})
// clear it
await clearInterval(id);
interval(cb: function, intervalLength: number | Infinity, options: IOptions): Promise<void>;
Argument | Attritubes | Description |
---|---|---|
cb | function | Required Function to execute for each interval. MUST return a promise. Two arguments are passed to this function.
|
intervalLength | number | function | Required Length in ms to wait between iterations. Should be (or return) a non-negative integer. If a function is used, one parameter iterationNumber (starting at 1) is passed. |
options | object | Optional settings (detailed below). |
options.iterations | number | Default: Infinity The number of times to execute the function. Must be Infinity or an integer greater than 0. (note: counting from 0) |
options.stopOnError | boolean | Default: true If true, no subsequent calls will be made. The promise returned by interval() will be rejected and pass through the error thrown. |
clearInterval(id: string): Promise<void>;
Argument | Attritubes | Description |
---|---|---|
id | string | Required ID returned by an interval |
It will be called with "0" once (the initial call for the first run), and after that "Infinity" if it is set to run Infinite, otherwise a normal number
FAQs
Interval Promise Re-write to TS
The npm package @hasezoey/interval-promise-ts receives a total of 2 weekly downloads. As such, @hasezoey/interval-promise-ts popularity was classified as not popular.
We found that @hasezoey/interval-promise-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.