Created
August 27, 2015 18:40
-
-
Save dherman/92c03e5a87e9a8ad606e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.prototype.resolve = function() { | |
let loader = new Reflect.Loader(); | |
let self = this; | |
loader[Reflect.Loader.resolve] = () => "whatevs"; | |
loader[Reflect.Loader.fetch] = function(whatevs) { | |
return self; | |
}; | |
return function(v) { | |
loader.load("whatevs"); // causes the loader to block on this promise for @@fetch | |
loader.provide(v); // causes the loader to resolve this promise | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment