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

nextjs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs

The fastest async handler.

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
decreased by-13.09%
Maintainers
1
Weekly downloads
 
Created
Source

Next Module - A low-level asynchronous function caller

Because asynchronous calls sucks out your brain without a proper async handler.

How it works?

  1. Create a Next Instance: var nextInstance = new Next(2, finish)
  2. Then you call nextInstance() as many times as you specified in the count. In this example it is 2.
  3. After nextInstance was called 2 times, the finish function will be called.

Example: How to handle multiple functions in asynchronous manner?

	// CREATE a Next Instance
	var next = new Next(2, finish);
	console.log('start');
	
	// This will happens at 5000 milliseconds
	setTimeout(function(){ console.log('A'); next(); }, 5000); 
	
	// This happens at 2000 milliseconds
	setTimeout(function(){ console.log('B'); next(); }, 2000); 
	
	// this happens at the end at 5000 milliseconds
	function finish(){ console.log('finished'); } 
	
	// output
	// 0ms 	  => start
	// 2000ms => B
	// 5000ms => A
	// 5000ms => finished

Next parameters

  • count: the number of times you will have to call the next() instance. required, integer
  • finish: finishing callback required, function

Keywords

FAQs

Package last updated on 12 Dec 2013

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