title: How to create custom events and call them using jQuery's .on()?
body: <p>I'm trying to write a small library in jQuery and I'd like to add some lifecycle events. I understand that I have to <code>return this;</code> at the end to continue chaining.</p>
  
  <p>Mockup of my library so far:</p>
  
  <pre><code>(function($))
    $.fn.myLibrary = function(){
  
      // some code here
      return this;
  
    }
  )(jQuery)
  </code></pre>
  
  <p>This is what I'd like the end result to be:</p>
  
  <pre><code>$('#selector').myLibrary({
      // some options
  })
  .on('myLibrary-deleting', function(){
      // some code
  });
  </code></pre>
  
  <p>I'm not sure if this question is phrased correctly but how do I extend jQuery's on function?</p>