@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;
}
}