static handleAsPromise ( action ) {
        let deferred = Utilities.defer();
        let args = Array.prototype.slice.call(arguments, 1);
        let possiblePromise = action.apply(null, args.concat(function ( error, result ) {
            if (deferred.status === 'pending') {
                error ? deferred.reject(error) : deferred.resolve(result);
            }
        }));
        if ( is.promise(possiblePromise) ) {
            return possiblePromise;
        } else {
            return deferred.promise;
        }
    }
/**
     * @description Method to provide ability to use for asynchronous actions "promise" flow.
     * <br/> Regardless of the action thread used.
     * <br/> <strong> NOTE </strong> Context binding to an action is strongly suggested.
     * <br/> Without binding action will lose the context, as any other callback function.
     * @example
     *  const handle = Core.utils.handleAsPromise;
     *  // promise flow
     *  let promise = handle(action.bind(ctx),a,r,g,u,m,e,n,t,s);
     *  promise.then(success => console.log('success', success));
     *  promise.catch(error => console.log('error', error));
     * @alias utils.handleAsPromise
     * @see {@link https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/Promise|native Promise}
     * @param {function} action - asynchronous action
     * @param {*} ...args - any type and any count of arguments to delegate it in the action
     * @returns {Promise} - to use promise way
     * @public
     */
@description Method to provide ability to use for asynchronous actions "promise" flow.
 Regardless of the action thread used.
  NOTE  Context binding to an action is strongly suggested.
 Without binding action will lose the context, as any other callback function.
@description Method to provide ability to use for asynchronous actions " promise " flow . Regardless of the action thread used . NOTE Context binding to an action is strongly suggested . Without binding action will lose the context as any other callback function .
static handleAsPromise ( action ) {
        let deferred = Utilities.defer();
        let args = Array.prototype.slice.call(arguments, 1);
        let possiblePromise = action.apply(null, args.concat(function ( error, result ) {
            if (deferred.status === 'pending') {
                error ? deferred.reject(error) : deferred.resolve(result);
            }
        }));
        if ( is.promise(possiblePromise) ) {
            return possiblePromise;
        } else {
            return deferred.promise;
        }
    }
static handleAsPromise ( action ) { let deferred = Utilities . defer ( ) ; let args = Array . prototype . slice . call ( arguments , 1 ) ; let possiblePromise = action . apply ( null , args . concat ( function ( error , result ) { if ( deferred . status === 'pending' ) { error ? deferred . reject ( error ) : deferred . resolve ( result ) ; } } ) ) ; if ( is . promise ( possiblePromise ) ) { return possiblePromise ; } else { return deferred . promise ; } }
@description Method to provide ability to use for asynchronous actions "promise" flow.
@description Method to provide ability to use for asynchronous actions " promise " flow .