# type-signals

> Small and fast Signal library for Typescript.

Latest version **1.1.0** (published 2020-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install type-signals
pnpm add type-signals
yarn add type-signals
bun add type-signals
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-04-22 |
| First published | 2019-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 67.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Chad Engler |
| Maintainers | englercj |
| Keywords | typescript, signals, events |

## Links

- npm: https://www.npmjs.com/package/type-signals
- Repository: https://github.com/englercj/type-signals
- Issues: https://github.com/englercj/type-signals/issues
- npm.io page: https://npm.io/package/type-signals

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2020-04-22
- 1.0.3 — 2019-09-15
- 1.0.2 — 2019-09-15
- 1.0.1 — 2019-09-15
- 1.0.0 — 2019-09-15

## README

# Type Signals

Small and fast Signal library for Typescript.

Heavily inspired by [mini-signals](https://github.com/Hypercubed/mini-signals).

## Install

```
npm install type-signals
```

## Documentation

- https://englercj.github.io/type-signals/

## Example Usage

```ts
import { Signal } from 'type-signals';

type OnDoThingSignal = (foo: string, bar: string): void;
const mySignal = new Signal<OnDoThingSignal>();

const binding = mySignal.add(onSignal); // add listener
mySignal.dispatch('foo', 'bar');        // dispatch signal passing custom parameters
binding.detach();                       // remove a single listener

function onSignal(foo: string, bar: string)
{
    assert(foo === 'foo');
    assert(bar === 'bar');
}
```

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