Financial-Times/ftdomdelegate

Is it necessary for us to be able to support multiple eventType in a single #on?

matthew-andrews opened this issue · 4 comments

There are two main inconsistencies:-

  • In the .on(eventType, selector, handler[, eventData]) method the eventType supports multiple types and is space separated whereas multiple selector's are comma separated.
  • .on supports multiple eventTypes, .off doesn't.

Given these inconsistencies could we discuss whether it is necessary or useful for us to be able to support multiple eventType's in a single #on? Is that even useful? Can we drop the support for multiple, space separated eventType's?

I know this is a breaking API change (can we get away with just upping the major version number to v1.0.0?) but I think the less this module does, the better. @mattcg may have some ideas on how / if we should proceed...

Update - it looks like off does support multiple eventType's but this functionality is undocumented

In favour of this. Smallest, simplest lib possible.
On 13 Apr 2013 14:29, "Matt Andrews" notifications@github.com wrote:

There are two main inconsistencies:-

  • In the .on(eventType, selector, handler[, eventData]) method the
    eventType supports multiple types and is space separated whereas
    multiple selector's are comma separated.
  • .on supports multiple eventTypes, .off doesn't.

Given these inconsistencies could we discuss whether it is necessary or
useful for us to be able to support multiple eventType's in a single #on?
Is that even useful? Can we drop the support for multiple, space separated
eventType's?

I know this is a breaking API change (can we get away with just upping the
major version number to v1.0.0?) but I think the less this module does, the
better. @mattcg https://github.com/mattcg may have some ideas on how /
if we should proceed...


Reply to this email directly or view it on GitHubhttps://github.com//issues/12
.

I've confirmed in the FT web app & with @georgecrawford for The Economist HTML5 app that we don't use this functionality for either. So just need to decide how best to handle the breaking API change.

@wilsonpage, do you think simply bumping to v0.2.0 would be ok? Should we publish a version another v0.1.x version that has console.warn's each time multiple event types are on'd or off'd, warning that this functionality is deprecated?

I would say this warrants a v0.2.0 bump. Maybe avoid console.warn as it
could throw errors in old browsers if console is undefined right?

On Mon, Apr 15, 2013 at 4:00 PM, Matt Andrews notifications@github.comwrote:

I've confirmed in the FT web app & with @georgecrawfordhttps://github.com/georgecrawfordfor The Economist HTML5 app that we don't use this functionality for
either. So just need to decide how best to handle the breaking API change.

@wilsonpage https://github.com/wilsonpage, do you think simply bumping
to v0.2.0 would be ok? Should we publish a version another v0.1.x version
that has console.warn's each time multiple event types are on'd or off'd,
warning that this functionality is deprecated?


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-16390097
.

Thanks for the merge, bumped & npm published.