This file contains hidden or 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
/* | |
Using Es6 Proxies, I created an object that can resolve promises from a chained object accessor pattern. | |
simply await the values, or supply a callback to .then() and watch the magic. | |
*/ | |
Symbol.queue = Symbol("queue"); //using Symbols to hide properties from being used or altered | |
Symbol.data = Symbol("data"); | |
function Promiser( obj ) { | |
return new Proxy(obj, { | |
get(target, prop){ |