{ status: 200 } if (x === foo) => // do something
which just seems (for this type of use case, maybe not all) like more boilerplate code for no real benefit over just doing something like if (res.status === 200 && res.x === foo) //do something
I would much prefer if there was some sort of special operator used to either check equality or to destructure when matching so it is obvious what the code is doing. let visFilter = 'foo';
const newState = match (action) {
{type: 'set-visibility-filter', filter: visFilter} => console.log(visFilter)
}
What happens?
I see this sentiment a lot but I honestly can't think of any non-trivial bugs that TS has caught for me. 99% of the bugs it catches I would see 1 second later when my page hot reloads and crashes.