WICG / EventListenerOptions

An extension to the DOM event pattern to allow authors to disable support for preventDefault
Other
1.17k stars 140 forks source link

should requireCancelable be an enum? #7

Closed RByers closed 9 years ago

RByers commented 9 years ago

@tdresser commented on the definition of requireCancelable:

Is there precedent for null being used to indicate the default value in APIs like this? Would an enum be clearer?

I'm not sure. I have a mild preference for boolean since this is really a 2-state switch. Another option might be to make it an optional member of the dictionary that's a simple boolean, rather than supporting an explicit 3rd value.

tdresser commented 9 years ago

I think it's somewhat more natural to use an optional boolean, and use lack of presence in the dictionary to indicate default behavior, instead of null.

I think an enum might be clearer though.

RByers commented 9 years ago

Irrelevant as of #9