Hello there 👋
this is going to be quick: how about using the bind operator at least
for destructuring?
// todayfunctionutil(ref) {
if (ref.prop === 1)
ref.method(2);
}
// tomorrow?functionutil({prop, ::method}) {
if (prop === 1)
method(2);
}
Such shortcut would simplify a lot of extra variables declarations and/or
destructuring, both in the DOM world utilities, and in general in various
helpers.
Thoughts?
Hello there 👋
this is going to be quick: how about using the bind operator *at least*
for destructuring?
```js
// today
function util(ref) {
if (ref.prop === 1)
ref.method(2);
}
// tomorrow?
function util({prop, ::method}) {
if (prop === 1)
method(2);
}
```
Such shortcut would simplify a lot of extra variables declarations and/or
destructuring, both in the DOM world utilities, and in general in various
helpers.
Thoughts?
Cheers!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20210113/9daa6dd7/attachment.html>
Hello there 👋 this is going to be quick: how about using the bind operator at least for destructuring?
// today function util(ref) { if (ref.prop === 1) ref.method(2); } // tomorrow? function util({prop, ::method}) { if (prop === 1) method(2); }
Such shortcut would simplify a lot of extra variables declarations and/or destructuring, both in the DOM world utilities, and in general in various helpers.
Thoughts?