Skip to content

faceofcat/Typescript-SimpleEvents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript-SimpleEvents

Build Status npm version npm downloads

Very very simple events system for type/java script.

Installation

In order to install it you can run:

$ npm install -g typescript-simpleevents

or, to install it locally:

$ npm install -D typescript-simpleevents

Usage

For more information check the wiki.

In javascript (node.js, not browser) you can:

var ev = require("typescript-simpleevents");
var x = new ev.SimpleEvent();
x.on(function () { console.log('costel was here.'); });
x.trigger();

In typescript you can do either:

import ev = require("typescript-simpleevents");

const x = new ev.SimpleEvent();
x.on(() => { console.log('costel was here.')});
x.trigger();

or

import { SimpleEvent } from "typescript-simpleevents";

const x = new SimpleEvent();
x.on(() => { console.log('costel was here.')});
x.trigger();

About

Very very simple events system for type/java script...

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published