clifinger / pub-sub-pattern-js-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests

Implement a Publish and Subscribe design pattern in JavaScript

Fork this repository and checkout using a branch pattern dev/your-name-here

Locate the file src/index.js and implement your basic pub-sub algorithm in EventBusFactory object.

const fire = (event, payload) => {
    // publish message here
};

const listen = (event, listener) => {
    // subscribe a message
};

const unsubscribe = (event, removeListener) => {
    // unsubscribe from event
};

Run test npm run test or npm test

Push your implementation to your branch name.

About


Languages

Language:JavaScript 100.0%