Skip to content

xorTap.js #2

@helloneoberg

Description

@helloneoberg

Hi, your solution interest me.
Pardon me if my questions sound silly.
May i know if the xorTap.js is complete as in:

(1) It is stated
@param {function...} actions the possible actions to take in order by number of clicks
@param {number} speed max delay between multi-clicks in milliseconds (optional, default: 300ms)
var xorTap = function()

It doesn't seem like your function is taking in parameters.

(2)
var actions = Array.prototype.slice.call(arguments), length = actions.length;

Where does "Array" and "arguments" being pass from?

(3)
I try to follow your index.html using typescript as i am using Angular Universal, thus i export your xorTap.js like this:

export default function func_xorTap() {
...
}

In my html:
var xorClick = func_xorTap(
function (e) {

      // single click action here
        console.log('tap - started :' + this.id + ' | ' + e.type);
    },
      function (e) {
        // double click action here
        console.log('tap - started :' + this.id + ' | ' + e.type);
      },
      function (e) {
        // double click action here
        console.log('tap - started :' + this.id + ' | ' + e.type);
      },
      MULTI_CLICK_DELAY);
    //console.log('xorClick : ' + xorClick);
    NGdatatable.addEventListener('tap', xorClick(), false);

I already have this error:
Error TS2346 (TS) Supplied parameters do not match any signature of call target.

Please advise me.
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions