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

Implement interactive restarting #55

Merged
merged 3 commits into from
Jan 11, 2025
Merged

Implement interactive restarting #55

merged 3 commits into from
Jan 11, 2025

Conversation

alexrutar
Copy link
Contributor

This PR implements interactive restarting. In order to implement this, unfortunately the type parameters T and R had to be added to the Event enum, since the Event enum now must carry a variant which can used to send an Injector<T, R> back to the Event source. This means type inference fails a bit more easily now, and adds some boilerplate to type annotations in certain situations. However, overall, having the type parameters T and R now accessible to the Event enum means adding new variants in the future involving the renderer or the picker item type will be non-breaking.

The interactive restarting was otherwise quite simple to implement inside the picker (just restart, and send a new injector down the channel). However incorporating it into an application can be a bit more work. Therefore I added reasonably comprehensive examples restart and restart_ext which demonstrate how this might be done in practice and why the API has the shape that it does.

@alexrutar alexrutar merged commit 708554e into master Jan 11, 2025
2 checks passed
@alexrutar alexrutar deleted the interactive-restart branch January 11, 2025 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant