| Post Reply | RetroFed Forum Forum Index » Svelte + SvelteKit |
| Author | Message | ||
|---|---|---|---|
Notnotmike
beehaw.org
Notnotmike@beehaw.orgJoined: 2023-06-10 |
I'm experienced with React and was just trying out a small Svelte to-do list to get my feet wet with Svelte and see if it's something I'd like to suggest we try out at work. However, there's one thing I wanted to clarify that wasn't immediately obvious from the documentation (and to just kickstart some discussion since this community is a little quiet). In React, if I have a large file doing a good amount of logic, like in the to-list example where I have add logic, remove logic, and toggle logic, all of which can be complex in their own ways if you improve them enough, I am able to extract the logic out into it's own file by creating a custom hook. Like so
Then, I can bring that into my component file by simply doing Any insight you guys can give would be great! Additionally, I'd love to be able to move the |
||
| 1 Original | |||
| Post Reply |
Back to top |