# backbone-esnext-events

> Separates 'events' support from Backbone in addition to adding TyphonJS extensions.

Latest version **0.3.5** (published 2017-07-12) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install backbone-esnext-events
pnpm add backbone-esnext-events
yarn add backbone-esnext-events
bun add backbone-esnext-events
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.5 |
| Published | 2017-07-12 |
| First published | 2017-01-03 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | typhonrt |
| Maintainers | typhonrt |
| Keywords | backbone, esnext, events, eventbus |

## Links

- npm: https://www.npmjs.com/package/backbone-esnext-events
- Repository: https://github.com/typhonjs-backbone-esnext/backbone-esnext-events
- Issues: https://github.com/typhonjs-backbone-esnext/backbone-esnext-events/issues
- npm.io page: https://npm.io/package/backbone-esnext-events

## Dependencies (1)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.0.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.3.5 (latest) — 2017-07-12
- 0.3.4 — 2017-03-22
- 0.3.3 — 2017-03-10
- 0.3.2 — 2017-03-07
- 0.3.1 — 2017-01-28
- 0.3.0 — 2017-01-09
- 0.2.0 — 2017-01-06
- 0.1.0 — 2017-01-03

## README

![backbone-esnext-events](http://i.imgur.com/gfeYvBh.png)

[![NPM](https://img.shields.io/npm/v/backbone-esnext-events.svg?label=npm)](https://www.npmjs.com/package/backbone-esnext-events)
[![Documentation](http://docs.typhonjs.io/typhonjs-backbone-esnext/backbone-esnext-events/badge.svg)](http://docs.typhonjs.io/typhonjs-backbone-esnext/backbone-esnext-events/)
[![Code Style](https://img.shields.io/badge/code%20style-allman-yellowgreen.svg?style=flat)](https://en.wikipedia.org/wiki/Indent_style#Allman_style)
[![License](https://img.shields.io/badge/license-MPLv2-yellowgreen.svg?style=flat)](https://github.com/typhonjs-backbone/typhonjs-core-backbone-events/blob/master/LICENSE)
[![Gitter](https://img.shields.io/gitter/room/typhonjs/TyphonJS.svg)](https://gitter.im/typhonjs/TyphonJS)

[![Build Status](https://travis-ci.org/typhonjs-backbone-esnext/backbone-esnext-events.svg)](https://travis-ci.org/typhonjs-backbone-esnext/backbone-esnext-events)
[![Coverage](https://img.shields.io/codecov/c/github/typhonjs-backbone-esnext/backbone-esnext-events.svg)](https://codecov.io/github/typhonjs-backbone-esnext/backbone-esnext-events)
[![Dependency Status](https://david-dm.org/typhonjs-backbone-esnext/backbone-esnext-events.svg)](https://david-dm.org/typhonjs-backbone-esnext/backbone-esnext-events)

Separates 'Events' support from [backbone-esnext](https://github.com/typhonjs-backbone-esnext) in addition to adding TyphonJS extensions found in [TyphonEvents](https://github.com/typhonjs-backbone-esnext/backbone-esnext-events/blob/master/src/TyphonEvents.js). The events dispatch functionality is useful well outside the context of Backbone and is utilized across several TyphonJS repos. It should be noted that there are no dependencies with backbone-esnext-events and it can be used independently in any project without pulling in Underscore like Backbone does. 

The default trigger mechanism work justs as it does with Backbone:
- `trigger` - Invokes all targets matched with a one way message. 

TyphonEvents adds new functionality for triggering events. The following are new trigger mechanisms:

- `triggerDefer` - Defers invoking `trigger` to the next clock tick.
- `triggerSync` - Synchronously invokes all targets matched and passes back a single value or an array of results to the callee.
- `triggerAsync` - Asynchronously invokes all targets matched and passes back a promise resolved with a single value or an array of results through `Promise.all` which returns a single promise to the callee.

To import TyphonEvents and create a new instance: 
```
import Events from 'backbone-esnext-events';

const eventbus = new Events();

// or extend a class to add event functionality
 
export default class MyThing extends Events {}
```

Please see [backbone-esnext-eventbus](https://www.npmjs.com/package/backbone-esnext-eventbus) for a module which provides a default main eventbus instance for ease of use across modules.

---
_Source: https://npm.io/package/backbone-esnext-events · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
