@jkelio/event-observer

A simple event observer written in Vanilla TypeScript for the event communication between different JavaScript Layers using in pure JavaScript and of course Vanilla TypeScript projects. Maybe it is helpful for a MVC software architecture.

Stats

StarsIssuesVersionUpdatedCreatedSize
@jkelio/event-observer
101.1.03 years ago3 years agoMinified + gzip package size for @jkelio/event-observer in KB

Readme

Event Observer

A simple event observer with vanilla JavaScript for the event communication of different JavaScript Layers. Maybe it is helpful for a MVC software architecture.

Installation

npm install mypluralize --save

Usage

Javascript

var EventObserver = require('EventObserver');
var eventObserver = new EventObserver();
eventObserver.subscribe(() => {
    console.log('do some stuff');
});
eventObserver.emit();
Output should be 'do some stuff'

TypeScript

import { EventObserver } from 'EventObserver';
var eventObserver: EventObserver = new EventObserver();
eventObserver.subscribe(() => {
    console.log('do some stuff');
});
eventObserver.emit();
Output should be 'do some stuff'

AMD

define(function(require,exports,module){
  var pluralise = require('mypluralize');
});

Usage for browser or any other (non CJS) environment

You can just use your favorite CJS bundler. If you have no favorite yet? Maybe you can try: Browserify or Webpack

Test

npm run test

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.