1.0.3 • Published 4 months ago

@shanlabs/signaller v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

@shanlabs/signaller

A simple event signaling library for JavaScript/TypeScript.

Installation

npm install @shanlabs/signaller

Usage

import { createSignaller } from "@shanlabs/signaller";

const signaller = createSignaller();

signaller.on("event", (data) => {
  console.log("Received:", data);
});

signaller.emit("event", { hello: "world" });

API

createSignaller()

Creates a new signaller instance.

Instance Methods

  • on(event, handler) — Listen for an event.
  • emit(event, payload) — Emit an event with optional payload.
  • off(event, handler) — Remove a specific handler.

License

ISC

1.0.3

4 months ago

1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago

0.0.1

4 months ago