es6-promise-polyfill

WebJar for es6-promise-polyfill

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

https://github.com/lahmatiy/es6-promise-polyfill

Скачать es6-promise-polyfill

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

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

Зависимости

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

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

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

NPM version Build Status

ES6 Promise polyfill

This is a polyfill of ES6 Promise. The implementation based on Jake Archibald implementation a subset of rsvp.js. If you're wanting extra features and more debugging options, check out the full library.

For API details and how to use promises, see the JavaScript Promises HTML5Rocks article.

Notes

The main target: implementation should be conformance with browser's implementations and to be minimal as possible in size. So it's strictly polyfill of ES6 Promise specification and nothing more.

It passes both Promises/A+ test suite and rsvp.js test suite. And as small as 2,6KB min (or 1KB min+gzip).

The polyfill uses setImmediate if available, or fallback to use setTimeout. Use setImmediate polyfill by @YuzuJS to reach better performance.

How to use

Browser

To install:

bower install es6-promise-polyfill

To use:

<script src="bower_components/es6-promise-polyfill/promise.min.js"></script>
<script>
  var promise = new Promise(...);
</script>

Node.js

To install:

npm install es6-promise-polyfill

To use:

var Promise = require('es6-promise-polyfill').Promise;
var promise = new Promise(...);

AMD

To install:

npm install es6-promise-polyfill

To use:

define(['es6-promise-polyfill'], function(Promise) {
  var promise = new Promise(...);
});

Usage in IE<9

catch is a reserved word in IE<9, meaning promise.catch(func) throws a syntax error. To work around this, use a string to access the property:

promise['catch'](function(err) {
  // ...
});

Or use .then instead:

promise.then(undefined, function(err) {
  // ...
});

License

Licensed under the MIT License.

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

Версия
1.1.1