reinterval

WebJar for reinterval

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

reinterval
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

reinterval
WebJar for reinterval
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/4rzael/reInterval

Скачать reinterval

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/reinterval/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>reinterval</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/reinterval/
implementation 'org.webjars.npm:reinterval:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/reinterval/
implementation ("org.webjars.npm:reinterval:1.1.0")
'org.webjars.npm:reinterval:jar:1.1.0'
<dependency org="org.webjars.npm" name="reinterval" rev="1.1.0">
  <artifact name="reinterval" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='reinterval', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "reinterval" % "1.1.0"
[org.webjars.npm/reinterval "1.1.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

reInterval

TRAVIS

NPM

Reschedulable setInterval for node.js.

Note: Work highly inspired by mcollina's retimer.

Example

var reInterval = require('reInterval');

var inter = reInterval(function () {
  console.log('this should be called after 13s');
}, 10 * 1000);

// This will reset/reschedule the interval after 3 seconds, therefore
// the interval callback won't be called for at least 13 seconds.
setTimeout(function () {
  inter.reschedule(10 * 1000);
}, 3 * 1000);

API:

###reInterval(callback, interval[, param1, param2, ...])

This is exactly like setInterval.

Arguments:

  • callback: The callback to be executed repeatedly.
  • interval: The number of milliseconds (thousandths of a second) that the reInterval() function should wait before each call to callback.
  • param1, param2, ...: (OPTIONAL) These arguments are passed to the callback function.

####returns an interval object with the following methods:

###interval.reschedule([interval])

This function resets the interval and restarts it now.

Arguments:

  • interval: (OPTIONAL) This argument can be used to change the amount of milliseconds to wait before each call to the callback passed to the reInterval() function.

###interval.clear()

This function clears the interval. Can be used to temporarily clear the interval, which can be rescheduled at a later time.

###interval.destroy()

This function clears the interval, and will also clear the callback and params passed to reInterval, so calling this essentially just makes this object ready for overwriting with a new interval object.

Note:

Please ensure that either the interval.clear() or interval.destroy() function is called before overwriting the interval object, because the internal interval can continue to run in the background unless cleared.

license

MIT

Версии библиотеки

Версия
1.1.0