jquery.hook icon indicating copy to clipboard operation
jquery.hook copied to clipboard

Is there a reason why you `makeArray` twice?

Open yckart opened this issue 12 years ago • 3 comments

I've noticed that you use makeArray twice in unhook, has this a more fundamental reason?

$.unhook = function (fns) {
    fns = typeof fns === 'string' ? 
        fns.split(' ') : 
        $.makeArray(fns) // 1st makeArray
    ;

    jQuery.each( $.makeArray(fns), function (i, method) { // 2nd makeArray
        var cur = $.fn[ method ];

        if ( cur && cur.__hookold ) {               
            $.fn[ method ] = cur.__hookold;         
        }
    });
};

yckart avatar Mar 22 '13 14:03 yckart

I haven't looked at this in years. If you'd like access to this repo so you can fix it etc let me know.

aheckmann avatar Mar 22 '13 14:03 aheckmann

Ok, I'll bring this repo up to date. Stay tuned...

yckart avatar Mar 22 '13 14:03 yckart

@yckart I gave you commit access so feel free to make whatever changes you need.

aheckmann avatar Apr 07 '13 04:04 aheckmann