event-chain

WebJar for event-chain

Лицензия

Лицензия

MIT
Группа

Группа

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

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

event-chain
Последняя версия

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

0.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

event-chain
WebJar for event-chain
Ссылка на сайт

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

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

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

https://github.com/zackurben/event-chain

Скачать event-chain

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

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

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : debug jar [2.2.0,3)
org.webjars.npm : lodash.uniq jar [3.2.2,4)

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

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

event-chain

A simple way to chain events and control program flow asynchronously. Build Status

This is an open source project under the MIT license, see LICENSE.md for additional information.

Install

npm install --save event-chain

Example

var chain = require('event-chain')();

var example = chain.on(['one', 'two'], function() {
  console.log('foo');
});

example.emit('one');
example.emit('two');
// foo to console.

Debug

Debugging is made possible with Debug and can be enabled by setting the environment variable event-chain:

env DEBUG=event-chain

API

chain.on(events, callback)
/**
 * Create an event-chain that will execute the callback after all the events have been emitted.
 *
 * @param events
 *   An array of events (string) that are required before invoking the callback.
 * @param callback
 *   A callback function to be executed after all the provided events have been fired.
 *
 * @return
 *   A Chain object.
 */
chain.on(events, callback)
chain.emit(event)
/**
 * Emit the given event for the chain.
 *
 * @param event
 *   Emit an event that was previously registered with chain.on();
 */
foo.emit(event);

Options

Customized options are available for the chain.

var chain = require('event-chain')(options);
options.complete (optional)
The event that is fired once all user-defined events have completed, used internally. Default: '__complete'

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

Версия
0.0.1