async-settle

WebJar for async-settle

Лицензия

Лицензия

MIT
Группа

Группа

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

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

async-settle
Последняя версия

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

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

async-settle
WebJar for async-settle
Ссылка на сайт

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

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

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

https://github.com/gulpjs/async-settle

Скачать async-settle

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

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

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : async-done jar [1.2.2,2)

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

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

async-settle

NPM version Downloads Build Status AppVeyor Build Status Coveralls Status Gitter chat

Settle an async function. It will always complete successfully with an object of the resulting state.

Handles completion and errors for callbacks, promises, observables and streams.

Will run call the function on nextTick. This will cause all functions to be async.

Usage

Successful completion

var asyncSettle = require('async-settle');

asyncSettle(function(done){
  // do async things
  done(null, 2);
}, function(error, result){
  // `error` will ALWAYS be null on execution of the first function.
  // `result` will ALWAYS be a settled object with the result or error of the first function.
});

Failed completion

var asyncSettle = require('async-settle');

asyncSettle(function(done){
  // do async things
  done(new Error('Some Error Occurred'));
}, function(error, result){
  // `error` will ALWAYS be null on execution of the first function.
  // `result` will ALWAYS be a settled object with the result or error of the first function.
});

API

asyncSettle(fn, callback)

Takes a function to execute (fn) and a function to call on completion (callback).

fn([done])

Optionally takes a callback (done) to call when async tasks are complete.

Executed in the context of async-done, with all errors and results being settled.

Completion is handled by async-done completion and error resolution.

callback(error, result)

Called on completion of fn and recieves a settled object as the result argument.

The error argument will always be null.

Settled Object

Settled values have two properties, state and value.

state has two possible options 'error' and 'success'.

value will be the value passed to original callback.

License

MIT

org.webjars.npm

gulp

A toolkit to automate & enhance your workflow

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

Версия
1.0.0