# state-emitter

> An emitter that auto-triggers new handlers once a state was switched on.

Latest version **0.3.0** (published 2015-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install state-emitter
pnpm add state-emitter
yarn add state-emitter
bun add state-emitter
```

## 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.0 |
| Published | 2015-07-30 |
| First published | 2015-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zoltan Kochan |
| Maintainers | zkochan |
| Keywords | state, emitter |

## Links

- npm: https://www.npmjs.com/package/state-emitter
- Repository: https://github.com/zkochan/state-emitter
- Homepage: https://github.com/zkochan/state-emitter#readme
- Issues: https://github.com/zkochan/state-emitter/issues
- npm.io page: https://npm.io/package/state-emitter

## 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.0 (latest) — 2015-07-30
- 0.2.0 — 2015-07-29
- 0.1.1 — 2015-07-28
- 0.1.0 — 2015-07-23

## README

# state-emitter

An emitter that auto-triggers new handlers once a state was switched on.

[![Dependency Status](https://david-dm.org/zkochan/state-emitter/status.svg?style=flat)](https://david-dm.org/zkochan/state-emitter)
[![Build Status](https://travis-ci.org/zkochan/state-emitter.svg?branch=master)](https://travis-ci.org/zkochan/state-emitter)
[![npm version](https://badge.fury.io/js/state-emitter.svg)](http://badge.fury.io/js/state-emitter)


# Installation

```
npm install --save state-emitter
```


## Usage

```js
var StateEmitter = require('state-emitter');

var stateEmitter = new StateEmitter();
stateEmitter.once('ready', function(msg) {
  /* some code on ready */
});

stateEmitter.state('ready', 'Hello world');

/* this one will be executed immediately because already ready */
stateEmitter.once('ready', function(msg) {
  /* some code on ready */
});
```


## License

MIT

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