New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

task-handler

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

task-handler - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

package.json
{
"name": "task-handler",
"version": "1.0.4",
"version": "1.0.5",
"description": "Handle Javascript Timers in a manageable way",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -105,2 +105,49 @@ # task-handler

Documentation coming soon...
```js
// public interface for TaskHandler
class TaskHandler {
// how many scheduled tasks of any type do we have?
get size(): number
// create a timeout, cancelling any timeouts
// currently scheduled with the given id if any
after(
id: TaskID,
delay: number,
fn: CallbackFn,
...args: Array<any>
): CallbackRef
defer(id: TaskID, fn: CallbackFn, ...args: Array<any>): CallbackRef
every(
id: TaskID,
interval: number,
fn: CallbackFn,
...args: Array<any>
): CallbackRef
everyNow(
id: TaskID,
interval: number,
fn: CallbackFn,
...args: Array<any>
): CallbackRef
// cancel the given timeout (optionally provide a type if it should only
// be cancelled if its of the given type).
// returns true if a task was cancelled.
cancel(id: TaskID, type?: TaskTypes): boolean
// cancel all of a given type (or all if no argument provided)
clear(...types: Array<TaskTypes>): void
// are the given tasks currently scheduled? returns true if all tasks
// given are present.
has(...ids: Array<TaskID>): boolean
}
```
### `TaskRef` (Object)

@@ -107,0 +154,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc