Skip to content
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

More convenient events for popular cases #17

Closed
raquo opened this issue Apr 15, 2018 · 2 comments
Closed

More convenient events for popular cases #17

raquo opened this issue Apr 15, 2018 · 2 comments

Comments

@raquo
Copy link
Owner

raquo commented Apr 15, 2018

For example, desired syntax:

input(
  onChecked --> booleanEventBus,
  onChecked.preventDefault --> booleanEventBus,
  onInputString --> stringEventBus
)

Whereas currently we need incantations like this for e.g. onChecked:

input(
  inContext(thisNode => onClick.preventDefault.mapTo(thisNode.ref.checked) --> booleanEventBus)
)

Which is type safe, and fairly straightforward if you know Laminar's features, but still annoyingly long.

Not sure yet how best to implement this, current event handling is not flexible enough to easily support this, but it's also something that I've wanted to refactor for a while now. The whole EventPropTransformation / EventPropEmitter stuff can probably be done better.

@raquo
Copy link
Owner Author

raquo commented Apr 15, 2018

Oh and consider some syntax sugar for things like filtering events by KeyCode

@raquo
Copy link
Owner Author

raquo commented Feb 26, 2021

0.12.0 addresses a lot of this with mapToValue / mapToChecked, composedEvents, etc.

@raquo raquo closed this as completed Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant