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

Development blocked due to Svelte limitation #2

Open
Shyrro opened this issue Nov 1, 2022 · 0 comments
Open

Development blocked due to Svelte limitation #2

Shyrro opened this issue Nov 1, 2022 · 0 comments
Labels

Comments

@Shyrro
Copy link
Owner

Shyrro commented Nov 1, 2022

Currently not possible to move forward with this lib, due to this :

ATM, it is not possible to dynamically get parent events.

Having this :

<!-- Parent  -->
<script>
    import MyComp from './MyComp'
    let msg = ''
</script>
<MyComp on:click={() => console.log('click')} on:keydown={() => console.log('keydown')} />

This won't work as there is currently no way to get parent events from the child component dynamically.
To achieve this, i would need to have props that have a clickHandler and keydownHandler to pass to the child component.
The more events you have, the more it is painful.

This also blocks composing components heavily. As even if you can get the events, there is no way to spread them into your child component.
Though, i we are able to get the events, i can get around this point by using the use directive and appending the events myself.

It would be nice to have something like $$props but for events, something like $$events

@Shyrro Shyrro added the blocked label Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant