You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The repl would check if this method exists and if it does, it would call it then wait for its result.
Why?
It's less to write. In the REPL it's nice to be lazy.
The command might have a lot of output so forcing it to finish before continuing might lead to a better user experience that library authors could decide to provide. Users could opt out by capturing the promise.
This would allow library authors to change behaviour when it's used like this.
The text was updated successfully, but these errors were encountered:
I've been thinking about this more and adding an await keyword is really not that bad. Also received this feedback:
personally I'm not fan of adding repl specific behavior, so the code you write in the repl you can't just copy paste it into a file (you'll need to add back those await)
...and the more I think about it, the more I agree. Not providing an await keyword in the REPL creates a bad habit of not providing the await keyword in normal code. So I'm going to close this suggestion.
It would be useful to provide the repl an expression that returns an object, which can tell the Deno REPL to wait for its completion.
Example:
Real example with https://github.com/dsherret/dax:
Object Author Implementation
Instead of resolving all promises this way, we could provide a custom method similar to
Deno.customInspect
, like so:If someone wanted to re-use their promise implementation they would just do:
REPL Implementation
The repl would check if this method exists and if it does, it would call it then wait for its result.
Why?
The text was updated successfully, but these errors were encountered: