You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per discussion in Bitovi #general, it would be nice to allow the ability to export an events object if you need to do document-level events in cases where you do not have an app-level component.
Perhaps this would work by making a generic can-control on the document and utilizing the default export of whatever file we import using can-import[as="events"]
Example
In mobile, in order to get nice and responsive :hover interactions on buttons, you need to add and
remove a class on touchstart and touchend events, respectively. This might look like the following:
Sounds good to me. Would it make more sense to export an object or to export a can-control constructor? You'd get a little more flexibility if you exported a constructor. It would also be easier on the done-autorender code, if you just exported an object it would mean done-autorender would have to depend on can-control. Not a big deal either way, just throwing the idea out there.
@matthewp I think it should allow for both, if you export a plain object, it should convert it to a can-control for you; however, if you export either an instance or constructor function of an inherited can-control it should use it as is.
@justinbmeyer I suppose you could, though it feels less explicit doing it that way.
Per discussion in Bitovi #general, it would be nice to allow the ability to export an events object if you need to do document-level events in cases where you do not have an app-level component.
Perhaps this would work by making a generic
can-control
on the document and utilizing the default export of whatever file we import usingcan-import[as="events"]
Example
In mobile, in order to get nice and responsive
:hover
interactions on buttons, you need to add andremove a class on
touchstart
andtouchend
events, respectively. This might look like the following:src/events.js
src/index.stache
The text was updated successfully, but these errors were encountered: