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

[Full-stack Signals] Make signal operations thenable #2712

Closed
Legioth opened this issue Sep 9, 2024 · 0 comments · Fixed by #2799
Closed

[Full-stack Signals] Make signal operations thenable #2712

Legioth opened this issue Sep 9, 2024 · 0 comments · Fixed by #2799
Assignees
Labels
hilla Issues related to Hilla

Comments

@Legioth
Copy link
Member

Legioth commented Sep 9, 2024

All client-side operations that may modify the value of a signal should return a thenable object that will be resolved once it has been confirmed that the operation has been processed on the server.

Note that this is a custom object with a then method rather than a full-blown Promise since the object will also have other properties. Most of the other properties are specific to the operation but there's also a universal cancel() function that will prevent the operation from being sent to the server if it hasn't already been sent (no guarantee that the cancellation will actually succeed). The thenable type can be void for now but will eventually be customized for various operations to reflect what the operation actually did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hilla Issues related to Hilla
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants