1.0.9 • Published 2 years ago

bucket-events v1.0.9

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

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!"
1.0.9

2 years ago

1.0.8

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago