skipfirst

1.0.1 • Public • Published

Skipfirst

Skip first time condition are true and call function next time.

Install

With npm:

npm i skipfirst --save

or with bower:

bower i skipfirst --save

How to use?

var skipfirst   = require('skipfirst'),
    skip        = skipfirst(function(identifier) {
        console.log('first was skiped:', identifier);
    });
 
/* 
 * first <enter> key press would be skiped 
 * and called next time
 *
 * clear times when <escape> pressed.
 */
window.addEventListener('keydown', function(event) {
    var key         = event.keyCode,
        identifier  = event.keyIdentifier,
        ENTER       = 13,
        ESC         = 27;
    
    if (key === ESC)
        skip.clear();
    else
        skip(key === ENTER, identifier);
});

License

MIT

/skipfirst/

    Package Sidebar

    Install

    npm i skipfirst

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • coderaiser