diff --git a/src/fastTimeout.js b/src/fastTimeout.js index 908e925..6659922 100644 --- a/src/fastTimeout.js +++ b/src/fastTimeout.js @@ -40,5 +40,6 @@ function enable() { } var hasSetImmediate = (typeof setImmediate === 'function'); +var hasPostMessage = (typeof self.postMessage === 'function'); -export default hasSetImmediate ? setImmediate : enable(); +export default hasPostMessage ? enable() : hasSetImmediate ? setImmediate : _.defer;