select.js
function into(impl) {
    /**
     * @param {string} selector
     * @param {Document|Element} [context]
     */
    return function(selector, context) {
        var callContext = this,
            extra;

        if (typeof selector === "string") {
            if (context && context.querySelector) {
                extra = Array.prototype.slice.call(arguments, 2);
            } else {
                extra = Array.prototype.slice.call(arguments, 1);
                context = document;
            }
            
            select(selector, context, function(elem) {
                impl.apply(callContext, [elem].concat(extra));
            });
        } else {
            impl.apply(callContext, arguments);
        }
    };
}
function into(impl) {
    /**
     * @param {string} selector
     * @param {Document|Element} [context]
     */
    return function(selector, context) {
        var callContext = this,
            extra;

        if (typeof selector === "string") {
            if (context && context.querySelector) {
                extra = Array.prototype.slice.call(arguments, 2);
            } else {
                extra = Array.prototype.slice.call(arguments, 1);
                context = document;
            }
            
            select(selector, context, function(elem) {
                impl.apply(callContext, [elem].concat(extra));
            });
        } else {
            impl.apply(callContext, arguments);
        }
    };
}
function into ( impl ) { /**
     * @param {string} selector
     * @param {Document|Element} [context]
     */ return function ( selector , context ) { var callContext = this , extra ; if ( typeof selector === "string" ) { if ( context && context . querySelector ) { extra = Array . prototype . slice . call ( arguments , 2 ) ; } else { extra = Array . prototype . slice . call ( arguments , 1 ) ; context = document ; } select ( selector , context , function ( elem ) { impl . apply ( callContext , [ elem ] . concat ( extra ) ) ; } ) ; } else { impl . apply ( callContext , arguments ) ; } } ; }
Create function composition which passes each selected element to a base
function.
@param {function} impl
@returns {function}
Create function composition which passes each selected element to a base function .