1.0.5 • Published 6 years ago

progressive-timeout v1.0.5

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

Progressive timeout

Simple implementation of progressive timeout in JavaScript.

Build Status npm npm

DEMO

progressive-timeout

Install

via NPM

npm install progressive-timeout --save

Usage

Define new instance of ProgressiveTimeout with providing calback function as first parametr and options object as second parametr. Options object should contain MIN, MAX and STEP properties. When the next tick reaches the MAX value, it becomes MAX.

import ProgressiveTimeout from 'progressive-timeout';

const OPTIONS = {
  min: 500,
  max: 20000,
  step: 2000,
};

progressiveTimeout = new ProgressiveTimeout(callback, OPTIONS);

start()

progressiveTimeout.start(); // now timeout tick increase every 'step' ms 

stop()

progressiveTimeout.stop(); // stop and clear timeout

License

This project is licensed under the MIT license, Copyright (c) 2018 Yuriy. For more information see LICENSE.

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

0.0.1

6 years ago

1.0.0

6 years ago