@anzerr/think.library
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

Intro

GitHub Actions status | publish

setInterval that waits for promises between ticks.

npm install --save git+https://github.com/anzerr/think.library.git
npm install --save @anzerr/think.library

Example

const Think = require('think.libary');

let wait = () => {
	return new Promise((resolve) => {
		setTimeout(resolve, 1000);
	});
};

let i = 0;
const t = new Think(() => {
	console.log('tick', i);
	if (i > 10) {
		t.stop();
	}
	t.start(); // should do nothing
	i += 1;
	return wait();
}, 100);

Readme

Keywords

Package Sidebar

Install

npm i @anzerr/think.library

Weekly Downloads

199

Version

1.0.14

License

MIT

Unpacked Size

3.47 kB

Total Files

5

Last publish

Collaborators

  • anzerr