refactor(Angular): add isPromiseLike helper function

This can be used internally to remove the repeating pattern of `obj && obj.then`. For now, I don't see a good reason to expose this in angular's public interface.

Conflicts:
	src/Angular.js
This commit is contained in:
Shahar Talmi
2014-07-23 01:15:59 +03:00
committed by Jeff Cross
parent 7f2bcc3933
commit e6ebfc87c9
6 changed files with 12 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
'use strict';
var isFunction = function isFunction(value){return typeof value == 'function';};
var isPromiseLike = function isPromiseLike(obj) {return obj && isFunction(obj.then);};
var $q = qFactory(process.nextTick, function noopExceptionHandler() {});