promise-inflight

WebJar for promise-inflight

Лицензия

Лицензия

ISC
Группа

Группа

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

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

promise-inflight
Последняя версия

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

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

promise-inflight
WebJar for promise-inflight
Ссылка на сайт

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

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

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

https://github.com/iarna/promise-inflight

Скачать promise-inflight

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

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

Зависимости

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

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

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

promise-inflight

One promise for multiple requests in flight to avoid async duplication

USAGE

const inflight = require('promise-inflight')

// some request that does some stuff
function req(key) {
  // key is any random string.  like a url or filename or whatever.
  return inflight(key, () => {
    // this is where you'd fetch the url or whatever
    return Promise.delay(100)
  })
}

// only assigns a single setTimeout
// when it dings, all thens get called with the same result.  (There's only
// one underlying promise.)
req('foo').then()
req('foo').then()
req('foo').then()
req('foo').then()

SEE ALSO

  • inflight - For the callback based function on which this is based.

STILL NEEDS

Tests!

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

Версия
1.0.1