Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-task

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-task

Execute tasks on web Workers without seperate files.

  • 0.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
61
increased by60.53%
Maintainers
1
Weekly downloads
 
Created
Source

AsyncTask

Execute tasks on web Workers without seperate files.

var AsyncTask = require( 'async-task' ).AsyncTask

var task = new AsyncTask({
  doInBackground: function( a, b ) {
    return a + b
  }
})

task.execute(1, 2, function( result ){
  result === 3
})

Or using promises

var AsyncTask         = require( 'async-task' ).AsyncTask,
    PromiseInterface  = require( 'async-task' ).PromiseInterface

AsyncTask.defaults.asyncInterface = PromiseInterface

var task = new AsyncTask({
  doInBackground: function( a, b ) {
    return a + b
  }
})

task
  .execute(1, 2)
  .then(function( result ) {
    result === 3
  })
  .error( handleError )
  .catch( handleException)

FAQs

Package last updated on 17 Nov 2014

Did you know?

Socket

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.

Install

Related posts

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