import isFunction from '../isFunction';
/*
 * Composes multiple callbacks into a single callback that will invoke them all with the same arguments.
 *
 * Usage:
 * onAdd={callAll(onAdd, onClose, close)}
 */
var callAll = function () {
    var callbacks = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        callbacks[_i] = arguments[_i];
    }
    return function () {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
        }
        return callbacks.filter(isFunction).forEach(function (callback) { return callback.apply(void 0, args); });
    };
};
export default callAll;
//# sourceMappingURL=callAll.js.map