1.2.1 • Published 2 years ago

@rbxts/task-event-emitter v1.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@rbxts/task-event-emitter

Event emitter for roblox-ts using stravant's GoodSignal class.

Installation

npm i @rbxts/task-event-emitter

Usage

Create an EventEmitter with an array of parameters:

const emitter = new EventEmitter<[player: Player]>(janitor);

Or, wrap an existing Roblox event:

const onChildAdded = EventEmitter.wrap(object.ChildAdded, janitor);

Example

import EventEmitter from "@rbxts/task-event-emitter";

const onChange = new EventEmitter<[property: string]>();

onChange.subscribe((property) => print(`Property ${property} changed!`));

onChange.emit("Name");
import EventEmitter from "@rbxts/task-event-emitter";

const emitter = new EventEmitter();

const subscription = emitter.subscribe(() => {});

if (!subscription.closed) {
	subscription.unsubscribe();
}
1.2.0

2 years ago

1.2.1

2 years ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago