1.1.0 • Published 4 years ago

@trayio/builder-squad-event-emitter v1.1.0

Weekly downloads
3
License
-
Repository
-
Last release
4 years ago

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

4 years ago

1.0.0

4 years ago