src/basis.js
function publicCallback(fn, permanent){
    var name = 'basisjsCallback' + genUID();

    global[name] = permanent ? fn : function(){
      try {
        // IE8 and lower can't delete from global
        delete global[name];
      } catch(e) {
        global[name] = undefined;
      }

      return fn.apply(this, arguments);
    };

    return name;
  }
function publicCallback(fn, permanent){
    var name = 'basisjsCallback' + genUID();

    global[name] = permanent ? fn : function(){
      try {
        // IE8 and lower can't delete from global
        delete global[name];
      } catch(e) {
        global[name] = undefined;
      }

      return fn.apply(this, arguments);
    };

    return name;
  }
function publicCallback ( fn , permanent ) { var name = 'basisjsCallback' + genUID ( ) ; global [ name ] = permanent ? fn : function ( ) { try { // IE8 and lower can't delete from global delete global [ name ] ; } catch ( e ) { global [ name ] = undefined ; } return fn . apply ( this , arguments ) ; } ; return name ; }
Generates name for function and registrates it in global scope.
@param {function()} fn Function that should available in global scope.
@param {boolean} permanent If false callback will be removed after fiest invoke.
@return {string} Function name in global scope.
Generates name for function and registrates it in global scope .