Re: Proposal Request

2019-06-26 Thread Oliver Dunk
Here! :) > On 26 Jun 2019, at 07:20, Joseph Akayesi wrote: > > Requesting to send a proposal for a new feature in ES. Where can I share the > proposal? > ___ > es-discuss mailing list > es-discuss@mozilla.org >

Re: ECMAScript feature suggestion: Streaming Array items through filter/map/reduce functions

2019-06-21 Thread Oliver Dunk
This seems like a good place to share the idea, and it’s helpful that you provided use cases etc. Is there a reason why you prefer the proposed syntax over the forEach loop you mentioned? Personally I like how the forEach is easy to understand, but maybe there are other examples of when the

Re: Re: Null-coalescing default values in destructuring

2019-05-10 Thread Oliver Dunk
> Given input valid JSON JSON.parse() or JSON.stringify() replacer function can > be utilized to substitute "undefined" for null. guest271314, that’s a lot of code! It feels like if anything, your example backs up the proposal. > `const { z =? 'a' } = { z: null };` I’m not sure I like the

Proposal: `maxDepth` on objects

2018-10-21 Thread Oliver Dunk
I’d love to see some sort of `maxDepth` property on objects. For `{}`, it would return `0`. In the case of `{keyOne: true}`, it would return `1`. For `{keyOne: {anotherKey: false}, keyTwo: false}`, it would return `2`. My particular use case is validating a JSON payload sent by a user to prevent

Re: Javascript Set Timezone Offset and time settings on Client

2018-04-29 Thread Oliver Dunk
I’d love to have this use milliseconds rather than minutes, so that we could kill two birds with one stone. For example, I currently have my own NTP integration for a web project I run, and for that the offset from the actual time could be quite small. > On 29 Apr 2018, at 18:07, Isiah Meadows

Re: Re: Proposal: Allow Promise callbacks to be removed

2018-04-24 Thread Oliver Dunk
Based on feedback, I agree that a blanket `Promise.prototype.clear()` is a bad idea. I don’t think that is worth pursuing. I still think that there is value in this, especially the adding and removing of listeners you have reference to as Andrea’s PoC shows. Listeners would prevent the

Re: Re: Proposal: Allow Promise callbacks to be removed

2018-04-23 Thread Oliver Dunk
> What happens to `p2` if I "unthen" `f` from `p1`? That’s an interesting point to explore. I would intuitively say p2 continues to exist, but is never resolved or rejected. > Interesting. I have a proof of concept that would let you do this Andrea, that’s pretty much exactly what I was

Proposal: Allow Promise callbacks to be removed

2018-04-23 Thread Oliver Dunk
My proposal is that we add a way of removing a particular callback, or all callbacks, from a Promise. This is different to cancelling a Promise and would instead happen if you want the operation to continue but are no longer interested in running a function when the Promise is resolved or