Goal: JavaScript async with minimal plumbing. Status: Using Proxy to make it look like a resolved Promise becomes its settled value.
-
-
Replying to @Anon0Mouse @TimSweeneyEpic
chainable version, keeps Promise val; does RxJS too. Promise pretending it's not. https://gist.github.com/tycho01/cab088c75f3cab131c3c41b97209fae0 …
#es61 reply 0 retweets 1 like -
Replying to @Tycho01 @Anon0Mouse
Some parts are tricky. To proxy a function, target must be set to a function in advance. Not sure what this breaks.
1 reply 0 retweets 0 likes -
Replying to @TimSweeneyEpic @Anon0Mouse
Yeah, ugh. `enumerate` trap was picky too, so can't trap everything... Also, I want an `iterate` trap.
1 reply 0 retweets 1 like -
Replying to @Tycho01 @Anon0Mouse
Seems impossible to correctly Proxy object and function without knowing type in advance.
1 reply 0 retweets 0 likes -
However, these limits are OK for my "lazy decentralized data" use case, where data types are explicitly controlled.
1 reply 0 retweets 0 likes -
Replying to @TimSweeneyEpic @Anon0Mouse
Yeah, will do for now. I wanna enable like `api.users[123].friends[1].id` for endpoint `/users/123/`, fetch/nav.
1 reply 0 retweets 1 like -
small follow-up experiment on that: https://github.com/tycho01/proxy-dsl/tree/master/src …
1 reply 0 retweets 0 likes
Right on! And you can proxy arrays with partial residency and steaming. Infinite shared read-only virtual memory.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.