Skip to content
This repository has been archived by the owner on Feb 9, 2019. It is now read-only.

skyrpex/tryuntil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Try Until

A small library providing an utility method to perform safe intervals.

Installation

npm install @skyrpex/tryuntil --save

Usage

import tryUntil from "@skyrpex/tryuntil";
tryUntil(done => {
	if ("something" in global) {
		done(global.something);
	}
});
import tryUntil from "@skyrpex/tryuntil";
const options = {
	frequency: 50,  // Minimum time between calls
	maxTime: 0,     // Maximum time before failing
	maxAttempts: 0, // Maximum attempts before failing
	context: global // Context of the given callback
};
tryUntil(done => {
	if ("something" in global) {
		done(global.something);
	}
}, options);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published