diff options
| author | Matias Niemelä | 2014-02-24 19:21:20 -0500 | 
|---|---|---|
| committer | Matias Niemelä | 2014-02-24 21:23:10 -0500 | 
| commit | 62761428eff3a53e69367449eb81869e59e75e39 (patch) | |
| tree | 40ce8ffa232cc38c821c78c29b0b811c45e406db /src/ng/asyncCallback.js | |
| parent | 04d7317cdd95ba00783389f89f6e9a7e1fc418f8 (diff) | |
| download | angular.js-62761428eff3a53e69367449eb81869e59e75e39.tar.bz2 | |
chore(core): create a wrapper to manage async callbacks
Diffstat (limited to 'src/ng/asyncCallback.js')
| -rw-r--r-- | src/ng/asyncCallback.js | 11 | 
1 files changed, 11 insertions, 0 deletions
| diff --git a/src/ng/asyncCallback.js b/src/ng/asyncCallback.js new file mode 100644 index 00000000..8bede73a --- /dev/null +++ b/src/ng/asyncCallback.js @@ -0,0 +1,11 @@ +'use strict'; + +function $$AsyncCallbackProvider(){ +  this.$get = ['$$rAF', '$timeout', function($$rAF, $timeout) { +    return $$rAF.supported +      ? function(fn) { return $$rAF(fn); } +      : function(fn) { +        return $timeout(fn, 0, false); +      }; +  }]; +} | 
