Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

tokio-js/orbit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orbit

Super fast event system for JS and TS

Exmaple (TS)

import * as orbit from "orbitjs";

const BUS = new orbit.Bus("Main");

class PlayerJoinEvent extends orbit.Event {
    public name: string;
    constructor(name: string) {
        super("PlayerJoinEvent");
        this.name = name;
    }
}

PlayerJoinEvent.link(BUS)

BUS.on<PlayerJoinEvent>("PlayerJoinEvent", async event => {
    console.log("Player Joined: " + event.name);
});

BUS.on("PlayerJoinEvent", async () => {
    console.log("Another Player joined");
});


BUS.post(
    new PlayerJoinEvent("Bob")
);

About

Super fast event system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages