An ultra rapid and super efficient event dispatcher framework for hyper fast coding in JavaScript.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Synchronous Dispatcher is deprecated!

Synchronous Dispatcher is deprecated. Development is continued in Metamatic package!


This is a synchronous dispatcher that enables you to dispatch application-wide events everywhere in your app and handle them everywhere inside your app. Simple is beautiful - and usually works better as well! This is a framework for no-nonsense fast coding. Just forget all academic theorizations for a second and try it out - You'll notice that this just works. Use it with Angular or React or whatever you like.

If you like to know more about Synchronous Dispatcher, please visit the blog post or check out a sample React App using Synchronous Dispatcher.


npm install synchronous-dispatcher


When you want to dispatch an event somewhere in your app:

import { dispatch } from 'synchronous-dispatcher';

dispatch('MY-EVENT', someObject);

And when you want to catch the event:

import { handle } from 'synchronous-dispatcher';

handle('MY-EVENT', function(item) {
  console.log('I catch the event here..');

You can also register a handler under specified ID. It is useful when you want to explicitely remove that handler later:

handle('MY-EVENT', 'MANAGER', function(item) {
  console.log('I catch the event here..');

Note that if you define a new handler for 'MY-EVENT' under same ID 'MANAGER', your new handler will override the previous one. If you want one event to launch many handlers, you must define each handler under different ID!

When you want to kill a certain handler for a certain event, in this case a handler with id 'MANAGER' for 'MY-EVENT':

import { unhandle } from 'synchronous-dispatcher';

unhandle('MY-EVENT', 'MANAGER')


Apache 2.0


Heikki Kupiainen / Oppikone


Please visit the blog post for tutorial.