deprecate .add/removeEventListener(...) in pro of .on/off(...)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

deprecate .add/removeEventListener(...) in pro of .on/off(...)

manuelbarzi
make it shorter, simpler and more handy

deprecate this
```
EventTarget.addEventListener(...)
EventTarget.removeEventListener(...)
```

in pro of
```
EventTarget.on(...)
EventTarget.off(...)
```

make it easier, more intuitive and more readable
```
button.on(‘click’, e => ...)
form.on('submit', e => ...)
document.on('DOMContentLoaded', () => ...)
...
```

(and reduce code length)

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: deprecate .add/removeEventListener(...) in pro of .on/off(...)

Jordan Harband
Neither of these methods, nor the DOM itself, are part of the JS language standard - you might be thinking of the HTML standard.

On Wed, Nov 28, 2018 at 11:28 AM manuelbarzi <[hidden email]> wrote:
make it shorter, simpler and more handy

deprecate this
```
EventTarget.addEventListener(...)
EventTarget.removeEventListener(...)
```

in pro of
```
EventTarget.on(...)
EventTarget.off(...)
```

make it easier, more intuitive and more readable
```
button.on(‘click’, e => ...)
form.on('submit', e => ...)
document.on('DOMContentLoaded', () => ...)
...
```

(and reduce code length)
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: deprecate .add/removeEventListener(...) in pro of .on/off(...)

Isiah Meadows-2
It *is* part of the DOM itself:
https://dom.spec.whatwg.org/#interface-eventtarget. Doesn't make this
any more on-topic here, though.

-----

Isiah Meadows
[hidden email]
www.isiahmeadows.com
On Wed, Nov 28, 2018 at 2:37 PM Jordan Harband <[hidden email]> wrote:

>
> Neither of these methods, nor the DOM itself, are part of the JS language standard - you might be thinking of the HTML standard.
>
> On Wed, Nov 28, 2018 at 11:28 AM manuelbarzi <[hidden email]> wrote:
>>
>> make it shorter, simpler and more handy
>>
>> deprecate this
>> ```
>> EventTarget.addEventListener(...)
>> EventTarget.removeEventListener(...)
>> ```
>>
>> in pro of
>> ```
>> EventTarget.on(...)
>> EventTarget.off(...)
>> ```
>>
>> make it easier, more intuitive and more readable
>> ```
>> button.on(‘click’, e => ...)
>> form.on('submit', e => ...)
>> document.on('DOMContentLoaded', () => ...)
>> ...
>> ```
>>
>> (and reduce code length)
>> _______________________________________________
>> es-discuss mailing list
>> [hidden email]
>> https://mail.mozilla.org/listinfo/es-discuss
>
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: deprecate .add/removeEventListener(...) in pro of .on/off(...)

Tab Atkins Jr.
Jordan meant that DOM isn't part of the JS standard. ^_^ So yeah, not
relevant to this list.
On Wed, Nov 28, 2018 at 11:39 AM Isiah Meadows <[hidden email]> wrote:

>
> It *is* part of the DOM itself:
> https://dom.spec.whatwg.org/#interface-eventtarget. Doesn't make this
> any more on-topic here, though.
>
> -----
>
> Isiah Meadows
> [hidden email]
> www.isiahmeadows.com
> On Wed, Nov 28, 2018 at 2:37 PM Jordan Harband <[hidden email]> wrote:
> >
> > Neither of these methods, nor the DOM itself, are part of the JS language standard - you might be thinking of the HTML standard.
> >
> > On Wed, Nov 28, 2018 at 11:28 AM manuelbarzi <[hidden email]> wrote:
> >>
> >> make it shorter, simpler and more handy
> >>
> >> deprecate this
> >> ```
> >> EventTarget.addEventListener(...)
> >> EventTarget.removeEventListener(...)
> >> ```
> >>
> >> in pro of
> >> ```
> >> EventTarget.on(...)
> >> EventTarget.off(...)
> >> ```
> >>
> >> make it easier, more intuitive and more readable
> >> ```
> >> button.on(‘click’, e => ...)
> >> form.on('submit', e => ...)
> >> document.on('DOMContentLoaded', () => ...)
> >> ...
> >> ```
> >>
> >> (and reduce code length)
> >> _______________________________________________
> >> es-discuss mailing list
> >> [hidden email]
> >> https://mail.mozilla.org/listinfo/es-discuss
> >
> > _______________________________________________
> > es-discuss mailing list
> > [hidden email]
> > https://mail.mozilla.org/listinfo/es-discuss
> _______________________________________________
> es-discuss mailing list
> [hidden email]
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: deprecate .add/removeEventListener(...) in pro of .on/off(...)

Isiah Meadows-2
Oh okay. I misread his response, then.
-----

Isiah Meadows
[hidden email]
www.isiahmeadows.com

On Wed, Nov 28, 2018 at 2:56 PM Tab Atkins Jr. <[hidden email]> wrote:

>
> Jordan meant that DOM isn't part of the JS standard. ^_^ So yeah, not
> relevant to this list.
> On Wed, Nov 28, 2018 at 11:39 AM Isiah Meadows <[hidden email]> wrote:
> >
> > It *is* part of the DOM itself:
> > https://dom.spec.whatwg.org/#interface-eventtarget. Doesn't make this
> > any more on-topic here, though.
> >
> > -----
> >
> > Isiah Meadows
> > [hidden email]
> > www.isiahmeadows.com
> > On Wed, Nov 28, 2018 at 2:37 PM Jordan Harband <[hidden email]> wrote:
> > >
> > > Neither of these methods, nor the DOM itself, are part of the JS language standard - you might be thinking of the HTML standard.
> > >
> > > On Wed, Nov 28, 2018 at 11:28 AM manuelbarzi <[hidden email]> wrote:
> > >>
> > >> make it shorter, simpler and more handy
> > >>
> > >> deprecate this
> > >> ```
> > >> EventTarget.addEventListener(...)
> > >> EventTarget.removeEventListener(...)
> > >> ```
> > >>
> > >> in pro of
> > >> ```
> > >> EventTarget.on(...)
> > >> EventTarget.off(...)
> > >> ```
> > >>
> > >> make it easier, more intuitive and more readable
> > >> ```
> > >> button.on(‘click’, e => ...)
> > >> form.on('submit', e => ...)
> > >> document.on('DOMContentLoaded', () => ...)
> > >> ...
> > >> ```
> > >>
> > >> (and reduce code length)
> > >> _______________________________________________
> > >> es-discuss mailing list
> > >> [hidden email]
> > >> https://mail.mozilla.org/listinfo/es-discuss
> > >
> > > _______________________________________________
> > > es-discuss mailing list
> > > [hidden email]
> > > https://mail.mozilla.org/listinfo/es-discuss
> > _______________________________________________
> > es-discuss mailing list
> > [hidden email]
> > https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss