Skip to content

hannaxd/asta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asta

A simple, mitt-inspired EventEmitter with once support

Usage

Simple:

import { asta } from "@rawrxd/asta";

const emitter = asta();

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

Event Map:

import { asta } from "@rawrxd/asta";

interface AppEvents {
  login: { username: string };
  logout: null;
}

const emitter = asta<AppEvents>();

emitter.on("login", ({ username }) => {
  console.log(`${username} logged in`);
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors