bucket-events
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

Bucket

TypeScript event library inspired on Bukkit's event system and ReflectedEventHandler.

⚠️ If you want to enjoy the library to the fullest and use decorators to register event handlers, you must enable experimentalDecorators & emitDecoratorMetadata on your tsconfig file.

Installation

npm i bucket-events

Usage

This code is taken from one of the examples

import ChatListener from './ChatListener';
import ChatEvent from './ChatEvent';
import { newEventManager } from 'bucket-events';

// Create a new event manager:
const manager = newEventManager();

const listener = new ChatListener();

// Register all event handlers on a listener instance:
manager.registerEvents(listener);

// Fire an event:
manager.fire(new ChatEvent('Lucas', 'hello world!')); // "author: Lucas, body: hello world!"

Dependencies (1)

Dev Dependencies (14)

Package Sidebar

Install

npm i bucket-events

Weekly Downloads

0

Version

1.0.9

License

ISC

Unpacked Size

20.4 kB

Total Files

40

Last publish

Collaborators

  • pragmare