# @rbxts/task-event-emitter

> Event emitter for roblox-ts using stravant's GoodSignal

Latest version **1.2.1** (published 2022-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rbxts/task-event-emitter
pnpm add @rbxts/task-event-emitter
yarn add @rbxts/task-event-emitter
bun add @rbxts/task-event-emitter
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2022-11-11 |
| First published | 2021-08-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | littensy |
| Maintainers | littensy |
| Keywords | GoodSignal, task, roblox-ts |

## Links

- npm: https://www.npmjs.com/package/@rbxts/task-event-emitter
- npm.io page: https://npm.io/package/@rbxts/task-event-emitter

## Recent versions

- 1.2.1 (latest) — 2022-11-11
- 1.2.0 — 2022-10-23
- 1.1.0 — 2021-09-16
- 1.0.5 — 2021-08-20
- 1.0.4 — 2021-08-12
- 1.0.3 — 2021-08-09
- 1.0.2 — 2021-08-09
- 1.0.1 — 2021-08-08
- 1.0.0 — 2021-08-08

## README

# @rbxts/task-event-emitter

Event emitter for roblox-ts using [stravant's GoodSignal class](https://devforum.roblox.com/t/lua-signal-class-comparison-optimal-goodsignal-class/1387063).

## Installation

```
npm i @rbxts/task-event-emitter
```

## Usage

Create an EventEmitter with an array of parameters:

```ts
const emitter = new EventEmitter<[player: Player]>(janitor);
```

Or, wrap an existing Roblox event:

```ts
const onChildAdded = EventEmitter.wrap(object.ChildAdded, janitor);
```

## Example

```ts
import EventEmitter from "@rbxts/task-event-emitter";

const onChange = new EventEmitter<[property: string]>();

onChange.subscribe((property) => print(`Property ${property} changed!`));

onChange.emit("Name");
```

```ts
import EventEmitter from "@rbxts/task-event-emitter";

const emitter = new EventEmitter();

const subscription = emitter.subscribe(() => {});

if (!subscription.closed) {
	subscription.unsubscribe();
}
```

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