title: Override JQuery functions (logging decorator)
body: <p>I'd like to create a logging decorator around jQuery function but it is called only once (in initialization time). How to fix it? Please look at the code.</p>
  
  <pre><code>function makeLogging(f) {
  
    function wrapper(...rest) {
        console.log(f.name);
        console.log(rest);
        return f.apply(this, rest);
      }
  
    return wrapper;
  }
  
  const task = $('.task');
  
  task.on = makeLogging(task.on);
  
  task.on('click', () =&gt; console.log('hi'));
  </code></pre>
  
  <p>The click event does not display messages about the called function.</p>