Skip to content
This repository was archived by the owner on Feb 1, 2019. It is now read-only.
This repository was archived by the owner on Feb 1, 2019. It is now read-only.

How should event arguments be passed through trigger? #13

@anselmbradford

Description

@anselmbradford

In this line there's a call to this.trigger( BaseTransition.BEGIN_EVENT, { target: this } ) with two arguments. The second argument creates an object { target: this } to emulate event.target that ends up inside event handlers for other events in JS. That calls this method, so that the event name ends up as the first argument. That means the signature for event handlers of this would end up looking like:

function handleEvent( eventName, eventObject ) { …

This differs from a native event signature that would look like:

function handleEvent( eventObject ) { …

Do we want to match the native format or do we want to have the event name separate and pass an arbitrary number of arguments?

cc @sebworks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions