File "redux-hook.js"

Full Path: /home/elegucvf/public_html/video/wp-content/plugins/atlas-core/framework/redux-core/assets/js/redux/redux-hook.js
File size: 534 bytes
MIME-type: text/plain
Charset: utf-8

/* jshint unused:false */

function redux_hook( object, functionName, callback, before ) {
	'use strict';

	(function ( originalFunction ) {
		object[functionName] = function () {
			var returnValue;

			if ( true === before ) {
				callback.apply( this, [returnValue, originalFunction, arguments] );
			}

			returnValue = originalFunction.apply( this, arguments );

			if ( true !== before ) {
				callback.apply( this, [returnValue, originalFunction, arguments] );
			}

			return returnValue;
		};
	}( object[functionName] ) );
}