Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hugojosefson/one-more-function

Tacks one more function onto the end of an existing function
https://github.com/hugojosefson/one-more-function

Last synced: 29 days ago
JSON representation

Tacks one more function onto the end of an existing function

Awesome Lists containing this project

README

        

# 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