stifle

WebJar for stifle

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

https://github.com/twobitfool/stifle

Скачать stifle

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

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

Зависимости

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

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

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

stifle

Wrap a function, so it is only called (at most) once every X milliseconds.

    var stifle = require('stifle')

    // A silly little clock
    function tellTime () {
      console.log('The time is now ' + new Date())
    }

    // Only show the time once per second
    var secondHand = stifle(tellTime, 1000)

    // Call it like crazy, but it will only fire once per second
    var interval = setInterval(secondHand, 10)

Cancellation

The wrapped function comes with a cancel method to kill any pending future invocations -- useful for shutting it down when a page or component is being unloaded.

    // Stop calling the secondHand
    clearInterval(interval)

    // Cancel pending calls, or else it will fire one more time
    secondHand.cancel()

No Extras

To keep it fast and simple, stifle does not support:

  • passing parameters
  • returning values
  • recursive invocation
  • "flushing" pending invocations
  • leading/trailing options

If you want those fancy features, check out lodash.throttle

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

Версия
1.1.0