vow

WebJar for vow

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

0.4.20
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

https://github.com/dfilatov/vow

Скачать vow

Имя Файла Размер
vow-0.4.20.pom
vow-0.4.20.jar 11 KB
vow-0.4.20-sources.jar 22 bytes
vow-0.4.20-javadoc.jar 22 bytes
Обзор

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

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

Зависимости

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

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

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

Vow NPM Version Build Status NPM Downloads

Vow is a Promises/A+ implementation. It also supports ES6 Promises specification.

Full API reference can be found at http://dfilatov.github.io/vow/.

Getting Started

In Node.js

You can install using Node Package Manager (npm):

npm install vow

In Browsers

<script type="text/javascript" src="vow.min.js"></script>

It also supports RequireJS module format and YM module format.

Vow has been tested in IE6+, Mozilla Firefox 3+, Chrome 5+, Safari 5+, Opera 10+.

Usage

Creating a promise

There are two possible ways to create a promise.

1. Using a deferred

function doSomethingAsync() {
    var deferred = vow.defer();
    
    // now you can resolve, reject, notify corresponging promise within `deferred`
    // e.g. `defer.resolve('ok');`
        
    return deferred.promise(); // and return corresponding promise to subscribe to reactions
}

doSomethingAsync().then(
    function() {}, // onFulfilled reaction
    function() {}, // onRejected reaction
    function() {}  // onNotified reaction
    );

The difference between deferred and promise is that deferred contains methods to resolve, reject and notify corresponding promise, but the promise by itself allows only to subscribe on these actions.

2. ES6-compatible way

function doSomethingAsync() {
    return new vow.Promise(function(resolve, reject, notify) {
        // now you can resolve, reject, notify the promise
    });
}

doSomethingAsync().then(
    function() {}, // onFulfilled reaction
    function() {}, // onRejected reaction
    function() {}  // onNotified reaction
    );

Extensions and related projects

  • vow-fs — vow-based file I/O for Node.js
  • vow-node — extension for vow to work with nodejs-style callbacks
  • vow-queue — vow-based task queue with weights and priorities
  • vow-asker — wraps asker API in the vow promises implementation

NOTE. Documentation for old versions of the library can be found at https://github.com/dfilatov/vow/blob/0.3.x/README.md.

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

Версия
0.4.20
0.4.12
0.4.8