flow.
.: Jan-Ivar :.
On 8/1/17 4:29 PM, Domenic Denicola wrote:
That is not why.
--------
*From:* Jan-Ivar Bruaroey
*Sent:* Aug 1, 2017 3:47 PM
*To:* es-discuss@mozilla.org
*Subject:* Re: Stream + async await
Because a promi
Because a promise is not a control surface of the asynchronous action
fulfilling it; confuses owner with consumer.
https://stackoverflow.com/a/41417429/918910
.: Jan-Ivar :.
On 7/31/17 7:35 AM, T.J. Crowder wrote:
Related: https://esdiscuss.org/topic/how-about-awaiting-arrays
(particularly th
Cancellable promises is dead. Please don't hijack this thread discussing
them.
Thanks,
.: Jan-Ivar :.
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
"resumption" option.
PTAL!
Some comments on the earlier thread here:
- The above fiddle suffers no accumulative "memory leak" problems. GC
just works.
- Synchronous inspection is necessary in multi-threaded cancellation
only, not JS.
.: Jan-Ivar :.
On 10/26/16 10:41
On 10/31/16 2:39 PM, Herby Vojčík wrote:
Jan-Ivar Bruaroey wrote:
On 10/28/16 8:39 AM, Bergi wrote:
Jan-Ivar Bruaroey wrote:
If you try the fiddle - http://jsfiddle.net/jib1/jz33qs32/ - you'll
see
cancelling terminates the chain. If you intersperse non-cancellable
operations, there
On 10/28/16 8:39 AM, Bergi wrote:
Jan-Ivar Bruaroey wrote:
If you try the fiddle - http://jsfiddle.net/jib1/jz33qs32/ - you'll see
cancelling terminates the chain. If you intersperse non-cancellable
operations, there'd be a delay if cancel is detected during those.
Yes, that
On 10/27/16 4:25 PM, Bergi wrote:
But you've got some good and important points.
Thanks!
Things to note:
- Cancellation is targeted to specific operations (no "cancel chain"
ambition).
I'd however love to be able to cancel specific chaining operations,
i.e. `then` callbacks.
If you try t
Likely this would be more convincing without a bug. Here is the correct
wait function:
let wait = (ms, cancel = new Promise(() => {})) => {
let id, both = x => [x, x];
cancel.then(...both(() => clearTimeout(id)));
return Promise.race([new Promise(resolve => id = setTimeout(resolve,
ms)),
This is an alternative to cancellable promises that relies entirely on
existing JavaScript.
I'm posting this here in hopes to bring the discussion back to practical
use cases and minimal needs.
Example:
Here's a setTimeout wrapper with cancellation, using a regular promise
as a cancellation
On 2/3/16 11:39 PM, Bob Myers wrote:
Promise.resolve(42) . then(wait(1000)) . then( /* cb */);
With ES6 I prefer the straightforward:
var wait = ms => new Promise(resolve => setTimeout(resolve, ms));
Promise.resolve(42) . then(() => wait(1000)).then(() => { /* cb */ });
Too simple t
Hi group! First post, so be gentle.
I love how arrow functions allow single arguments to be passed without
parenthesis, so I expected this to work:
Promise.all([true, false]).then([foo, bar] => console.log(foo +”,
"+ bar));
but it doesn't:
SyntaxError: invalid arrow-function argume
11 matches
Mail list logo