promiz

WebJar for promiz

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

promiz
Last Version

Last Version

1.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

promiz
WebJar for promiz
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/Zolmeister/promiz

Download promiz

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Promiz.js

Promises/A+ logo A polyfill for ES6-style Promises in 913 bytes (gzip) (v0.3 [Blog Post](http://www.zolmeister.com/2014/01/promiz-micro-promises-in-228-bytes.html)) ~~([How it was built](http://www.zolmeister.com/2013/07/promizjs.html))~~ ![build-status](https://travis-ci.org/Zolmeister/promiz.png?branch=master) ## Install ```bash # Node.js npm install promiz --save

Bower

bower install promiz --save

```html
<!-- Browser -->
<script src='promiz.js'></script>

Promiz - 913 bytes (min + gzip) - as reported by uglify.js

Promiz

HTML5rocks tutorial

Constructor - new Promise(Function<resolve, reject>)

var promise = new Promise(function (resolve, reject) {
  if ('itIsRaining' && Math.random() * 10 === 2) {
    reject(new Error('reason'))
  } else {
    resolve(42)
  }
})

Promise.reject({reason})

promise = Promise.reject(new Error('reason'))

Promise.resolve({value})

promise = Promise.resolve(42)

promise.then({Function}, {Function})

promise = Promise.resolve(42)
promise.then(function (success) {
  return 'Promise resolved to: ' + success
}, function (failure) {
  return 'Promise failed with: ' + failure
})

promise.catch({Function})

promise = Promise.reject(new Error('failure'))
promise.catch(function (failure) {
  return 'Promise failed with: ' + failure
})

Promise.all({iterable})

promise1 = Promise.resolve(1)
promise2 = Promise.resolve(2)
Promise.all([promise1, 123, promise2])
.then(function (promises) {
  promises[0] === 1
  promises[1] === 123
  promises[2] === 2
})

Promise.race({iterable})

promise1 = new Promise()
promise2 = new Promise()

setTimeout(function () {
  promise1.resolve('z')
}, 10)

setTimeout(function () {
  promise2.resolve('l')
}, 100)

Promise.race([promise1, promise2])
.then(function (winner) {
  winner === 'z'
})

Licence: MIT

Versions

Version
1.0.5