@trayio/builder-squad-event-emitter

1.1.0 • Public • Published

@trayio/builder-squad-event-emitter

This is a package to aid with the Tray.io Front-end engineer code test.

Installation

npm install @trayio/builder-squad-event-emitter

Usage

This package comes as a React Component. To use in your application, simply wrap it in this components like so:

import EventEmitter from '@trayio/builder-squad-event-emitter';

...

render() {
    return (
        <EventEmitter>
            <YourApp />
        </EventEmitter>
    )
}

Once this is done, it will pass down one extra prop to <YourApp named data-tray which looks like this:

{
    coords: {
        x: number;
        y: number;
    },
    connector: {
        iconURL: string;
        name: string;
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @trayio/builder-squad-event-emitter

Weekly Downloads

0

Version

1.1.0

License

none

Unpacked Size

35.5 kB

Total Files

4

Last publish

Collaborators

  • trayprod
  • johnbastian_trayio
  • thomaschaplin
  • simone_trayio