Skip to content
This repository was archived by the owner on Dec 6, 2018. It is now read-only.
This repository was archived by the owner on Dec 6, 2018. It is now read-only.

Finalize Custom Behaviors API #5

@ryanfitzer

Description

@ryanfitzer

You can already supply your own custom behaviors:

var meCustom = multiEvent({
    pointer: 'MSPointerOver',
    mouse: 'mouseover',
    touch: 'touchstart'
});

I'd like to also support each input declaring multiple events per input:

var meCustom = multiEvent({
    pointer: [ 'MSPointerOver', 'MSPointerDown' ],
    mouse: 'mouseover',
    touch: 'touchstart'
});

Pointer events are the only inputs I see as benefiting from this:

If event is pointerdown and input is touch
    Do this thing
Else if event is pointerover and input is mouse
    Do that thing

Arrays are supported in the resolveEvents function. The switch statement in MultiEvent.prototype.resolve is where the support needs to be added.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions