How to use the framebus.emit function in framebus

To help you get started, we’ve selected a few framebus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / framebus / framebus-tests.ts View on Github external
import * as framebus from "framebus";

let popup = window.open('https://example.com');
framebus.include(popup);
framebus.emit('hello popup and friends!');

framebus.target('https://example.com').on('my cool event', () => {});

let callback = (data: any) => {
    console.log('Got back %s as a reply!', data);
};

framebus.publish('Marco!', callback, 'http://listener.example.com');

framebus.publish('Marco!', callback, 'http://listener.example.com');

framebus

Framebus allows you to easily send messages across frames (and iframes) with a simple bus.

MIT
Latest version published 4 months ago

Package Health Score

78 / 100
Full package analysis

Similar packages