I'm not familiar with the JS proposal process. Is this likely to become an official feature now that it's been proposed? If so what's the usual timeline of that look like? I would love to have this feature ASAP in the browser and/or Node.js and am eager to find out when that will be possible.
JavaScript Pattern Matching Proposal
11–20 of 254 posts
Re: JavaScript Pattern Matching Proposal
#12Could someone please explain what this could be used for ?
I think the HTTP response is a great example. It can have many status codes which can determine how you want to proceed with that response. If you've worked with handling HTTP responses, you've most likely implemented some version of a 'match' operation before.
Re: JavaScript Pattern Matching Proposal
#13Pattern matching seems to be very trendy/popular right now. It's a big jump from JS, but https://reasonml.github.io has very nice pattern matching that you can use, and it integrates with the JS ecosystem very nicely.
Re: JavaScript Pattern Matching Proposal
#14I'm not familiar with the JS proposal process. Is this likely to become an official feature now that it's been proposed? If so what's the usual timeline of that look like? I would love to have this feature ASAP in the browser and/or Node.js and am eager to find out when that will be possible.
Someone will surely do a Babel plugin to use the syntax allowing you to try it before it becomes an official feature.
Re: JavaScript Pattern Matching Proposal
#15I should note, this isn't my proposal. Just found it interesting enough to share
Re: JavaScript Pattern Matching Proposal
#16I'm not familiar with the JS proposal process. Is this likely to become an official feature now that it's been proposed? If so what's the usual timeline of that look like? I would love to have this feature ASAP in the browser and/or Node.js and am eager to find out when that will be possible.
In terms of chances of standardization, that's a step up from "Hey, I have a great idea", buy there are plenty of Stage 0 proposals that go nowhere because they lose steam.
I think the metric they look for is who is using the Babel plugin for it. If people are doing that, then they it has a better shot of progressing.
Stage 4 is the "this is getting standardized next time" stage
Re: JavaScript Pattern Matching Proposal
#17I'm not familiar with the JS proposal process. Is this likely to become an official feature now that it's been proposed? If so what's the usual timeline of that look like? I would love to have this feature ASAP in the browser and/or Node.js and am eager to find out when that will be possible.
Someone will surely do a Babel plugin to use the syntax allowing you to try it before it becomes an official feature.
Re: JavaScript Pattern Matching Proposal
#18Pattern matching seems to be very trendy/popular right now. It's a big jump from JS, but https://reasonml.github.io has very nice pattern matching that you can use, and it integrates with the JS ecosystem very nicely.
It's been "trendy" since the 70's. It's more that more people have experience with it and realize that pattern matching is like conditional statements on steroids.
Re: JavaScript Pattern Matching Proposal
#19Re: JavaScript Pattern Matching Proposal
#20Could someone please explain what this could be used for ?
Smooshes the evaluation of an object that can be many different shapes into an easy to understand operation. I think the HTTP response is a great example. It can have many status codes which can determine how you want to proceed with that response. If you've worked with handling HTTP responses, you've most likely implemented some version of a 'match' operation before.