Skip to content

zorbyte/pubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PubSub for Deno

A simple PubSub module for deno.

Example

import { PubSub } from "https://deno.land/x/pubsub@0.0.5/mod.ts";

class Test {
  public x = "sfg";
}

const m = new PubSub();

m.subscribe(Test, (t) => {
  // Prints: Test { x: "sfg" }
  console.log(t);
});

m.publish(new Test());

m.subscribe(String, (s) => {
  // Prints: sdfg
  console.log(s);
});

m.publish("sdfg");

License

Licensed under the MIT License, checkout the LICENSE for more information.