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

Simplify and improve event/state management #18

Open
rishikanthc opened this issue Oct 16, 2024 · 2 comments
Open

Simplify and improve event/state management #18

rishikanthc opened this issue Oct 16, 2024 · 2 comments
Labels
good first issue Good for newcomers hacktoberfest Hacktoberfest contributions hacktoberfest-accepted Hacktoberfest contributions help wanted Extra attention is needed

Comments

@rishikanthc
Copy link
Owner

The current design of the app uses a slightly cumbersome method to handle events and states. Primarily, state changes are propagated via event bubbling which is supported by Svelte. This becomes quickly messy as you nest more components down deep as you have to propagate it up all the way to the top level component where the state change is handled.

Proposal

Using svelte custom stores would be a way more elegant approach to doing this. This way each component can independently update the require data and the store is refresh and all dependent components will auto update to the latest values.

Thoughts and ideas appreciated

@rishikanthc rishikanthc added help wanted Extra attention is needed good first issue Good for newcomers hacktoberfest-accepted Hacktoberfest contributions hacktoberfest Hacktoberfest contributions labels Oct 16, 2024
@ucffool
Copy link

ucffool commented Oct 22, 2024

Might need to use the new CLI to auto-update the code base to Svelte5 runes to make that process a lot easier/possible. It was in the presentation but I can't find docs detailing the process.

@rishikanthc
Copy link
Owner Author

Yeah I was thinking about this too. But I'm concerned if it might be too early to switch to svelte5 considering it just released.
For eg. I'm using bits-ui framework which hasn't upgraded to svelte5 yet.
So one line of thought is, it might be better to wait until libraries in the ecosystem start picking up svelte5 so we have better compatibility?

But you're right, svelte5 claims that it makes reactivity easier. So it might me worthwhile to first switch to svelte 5 and then fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest Hacktoberfest contributions hacktoberfest-accepted Hacktoberfest contributions help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants