Plugin callback functions: Return $(this) or this?

Plugin callback functions: Return $(this) or this?

Hi,

In my plugin, I wrote a private method to handle callbacks:

  1. function _call_back($_fun, $_obj) {
  2.    
  3.     if ($.isFunction($_fun)) {
  4.         $_fun.call($_obj);
  5.     }
  6.    
  7. };

In the guts of my plugin, there are times where I have easy access to "this":

  1. $foo.animate(..., function(){
  2.       _call_back(settings.callback1, this);
  3. });

But, there are other situations where $(this) is easier to return:

  1. $foo = $var.filter(':eq(' + index + ')');
  2. _call_back(settings.callback2, $foo);

When it comes to coding, I tend to like consistency, and don't like surprises... With that said, should I be returning the object lookup for all of my callbacks, or just the "this"?

For example, if I were to return "this" in my last example, I was thinking this would work:

  1. _call_back(settings.callback2, $foo[0]);

What do ya'll think?

Many TIA!

Cheers,
Micky