one-more-function

0.1.0 • Public • Published

one-more-function

Tacks one more function onto the end of an existing function.

Useful for adding another listener to for example window.onresize.

Example

Given:

    window.onresize = function () {
        console.log('onresize 1');
    };

You can add another one:

    window.onresize = oneMoreFunction(window.onresize, function () {
        console.log('onresize 2');
    });

When you resize the browser window,

Then you get:

    onresize 1
    onresize 2

License

MIT

Package Sidebar

Install

npm i one-more-function

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • hugojosefson