@cancunlabs/simple-event-bus

0.0.2 • Public • Published

Simple Evet Bus

When you work with differrent Web Components or Javascript Frameworks on same page or SPA, in many cases the problem is the same, How can I pass data between them?

Well the answer is, Simple Event Bus 😉

With Simple Event Bus you can pass data beetween components developed in React, VueJS or a simpre HTML Element.

Usage

Just add the script

    <script src="event-bus.min.js"></script>

and then

    window.Messenger.addEventListener('chat-message', event => {   
       console.log(event);
    });
    
    ...

    window.Messenger.dispatchEvent('chat-message', { text: 'I ❤️ You ' });

Enjoy It

Original code: https://pineco.de/creating-a-javascript-event-bus/

Readme

Keywords

none

Package Sidebar

Install

npm i @cancunlabs/simple-event-bus

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

11.3 kB

Total Files

7

Last publish

Collaborators

  • francis.tec