Closed idan closed 1 month ago
Latest commit: c9fd7f7d551f4abebedb1931d0a428f8d7136c03
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Name | Status | Preview | Last Commit |
---|---|---|---|
runed | ✅ Ready (View Log) | Visit Preview | c9fd7f7d551f4abebedb1931d0a428f8d7136c03 |
A lil' demo video of the demo at the top of the docs:
https://github.com/user-attachments/assets/fae59bbf-9252-4df5-b9f8-7e8e726b4960
Could you capitalize the types in the example code? It's a typescript convention.
@TGlide thanks, what a lovely review.
I fixed all the things except for the generic vs type assertion. I don't have a better idea, but from a DX perspective, I definitely want the current state to be of type StateT
not StateT | undefined
or anything like that.
Adds a new
useFSM
rune that allows you to create minimalistic finite state machines.Ported over from https://github.com/githubnext/tiny-svelte-fsm (which was already MIT, and I'm the author there). I made a couple of minor fixes along the way as well, mostly to enable people to call
.debounce
in actions and lifecycle handlers.This PR includes:
✅ Docs with an interactive demo and examples ✅ Tests
Per our conversation in the Svelte Discord: