-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
View Component consistancy #615
Comments
This comment was marked as abuse.
This comment was marked as abuse.
One more inconsistency worth fixing are the event args: |
In my opinion observe() for gestures cannot be replaced easily with on/addEventListener since in the first case (observe) you can listen for multiple gestures with single callback: var lbl = new Label();
lbl.observe(GestureTypes.tap | GestureTypes.doubleTap | GestureTypes.longPress, args => {
//
}); while with on/addEventListener you can listen for just one event: var btn = new Button();
btn.on(Button.tapEvent, args => {
//
}); |
This comment was marked as abuse.
This comment was marked as abuse.
Hi @NathanaelA, It will be hard to apply the same pattern for regular events since they are strings (the first argument of on/addEventListener) while gesture types are numbers and you can use them in bitwise operations. |
This comment was marked as abuse.
This comment was marked as abuse.
Hi @NathanaelA, Actually you are right - I've made pull request with on/off support for gestures. Please let me know if you have any questions! Thanks |
This comment was marked as abuse.
This comment was marked as abuse.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In the View component; we use .observe to connect our event handlers to any Gesture events. Is their some reason why we can't make this be a lot more consistent with the Observable event handling system and use the on, addEventListener, off, and removeEventListener functions? That way all events go through those functions.
This seems inconsistent to have some events connected via on and some events connected via observe
The text was updated successfully, but these errors were encountered: