mysticatea/event-target-shim

Feature request: make defineEventAttribute variadic

Open

#13 aperta il 25 mag 2018

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)TypeScript (29 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (130 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

right now, one has to do:

defineEventAttribute(Foo, "bar");
defineEventAttribute(Foo, "baz");
// or 
["bar", "baz"].forEach( name => defineEventAttribute(Foo, name));

Which is kinda ugly...

What would be nice is a variadic function:

defineEventAttribute(Foo, "bar", "baz" /*, ...and so on*/);
// or 
const attributes = ["bar", "baz"]
defineEventAttribute(Foo, ...attributes);

Guida contributor