Skip to content

Propagate events #6

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

Open
Rich-Harris opened this issue Apr 3, 2018 · 0 comments
Open

Propagate events #6

Rich-Harris opened this issue Apr 3, 2018 · 0 comments

Comments

@Rich-Harris
Copy link
Member

The corollary to #4 — there's currently no way to listen for events coming from a row component. One way would be to have a single catch-all event:

<VirtualList on:event='handleEvent(event)' ... />

In that situation, the row component would need to do this sort of thing:

<div on:click="fire('event', { type: 'select', row })">
  <!-- row markup here -->
</div>

It would be slightly nicer if the row component could look like this...

<div on:click="fire('select', { row })">
  <!-- row markup here -->
</div>

...but that would require some new way to propagate all events:

<:Component {component} on:* row={{item.data}} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant