+1 for omitting function keyword between export and function name. Declaring arrow functions without arrow in syntax - nope, nope, nope.
On 24 Oct 2017 7:01 pm, "Andrea Giammarchi" <andrea.giammar...@gmail.com> wrote: > to me this `export foo() {}` makes sense only as shortcut for `export > function foo() {}` and not as arrow, because arrow missing context and > arguments will mislead everyone exporting a named function. > > -1 > > On Tue, Oct 24, 2017 at 1:59 PM, Brian Blakely <anewpage.me...@gmail.com> > wrote: > >> As arrow function const assignments become the norm and non-arrows the >> exception, allowing syntactical cruft to fall away makes sense to me. It >> might be premature based on overall 2015 adoption, but I don't see this >> trend reversing. >> >> On Tue, Oct 24, 2017 at 12:54 PM, /#!/JoePea <j...@trusktr.io> wrote: >> >>> It can be confusing because it is too similar to non-arrow functions. >>> The arrow syntax is clear in meaning. >>> >>> */#!/*JoePea >>> >>> On Tue, Oct 24, 2017 at 9:51 AM, Brian Blakely <anewpage.me...@gmail.com >>> > wrote: >>> >>>> This syntax is shorter, easier to write, and arguably easier to read. >>>> What else does it need to offer? >>>> >>>> On Tue, Oct 24, 2017 at 12:48 PM, kai zhu <kaizhu...@gmail.com> wrote: >>>> >>>>> -1 >>>>> this fails styleguide sanity-check. >>>>> >>>>> we currently have 3 common styles of declaring functions: >>>>> 1. foo = function () {...} >>>>> 2. function foo () {...} >>>>> 3. foo = () => {...} >>>>> >>>>> does this extra 4th style offer anything new to justify making the >>>>> javascript language even less consistent than it already is? i say >>>>> no. >>>>> >>>>> >>>>> On 10/25/17, Brian Blakely <anewpage.me...@gmail.com> wrote: >>>>> > A prevalent pattern has emerged: >>>>> > >>>>> > `export const foo = ()=> { };` >>>>> > >>>>> > Taking a cue from short method syntax, this comes to mind as a >>>>> possible >>>>> > improvement: >>>>> > >>>>> > `export const foo() { };` >>>>> > >>>>> > Even better if we assume const: >>>>> > >>>>> > `export foo() { };` >>>>> > >>>>> > That is delicious. Thoughts? >>>>> > >>>>> >>>> >>>> >>>> _______________________________________________ >>>> es-discuss mailing list >>>> es-discuss@mozilla.org >>>> https://mail.mozilla.org/listinfo/es-discuss >>>> >>>> >>> >> >> _______________________________________________ >> es-discuss mailing list >> es-discuss@mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> >> > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss