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

Replace initialRun with onStart #42

Open
gajus opened this issue Apr 10, 2023 · 1 comment
Open

Replace initialRun with onStart #42

gajus opened this issue Apr 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@gajus
Copy link
Owner

gajus commented Apr 10, 2023

As reported in #41, the initialRun API might be a bit confusing for first-time users because it triggers onChange with an empty array. A simpler API would be to simply add onStart hook. However, there are trade-offs.

At the moment, initialRun triggers onChange, which if it fails, user could just re-run it the next time a change is detected. Adding onStart means that we need to think of how to handle onStart failing.

Open questions:

  • If onStart fails, should it be restarted?
  • If onStart fails, should Turbowatch exit with an error?
  • Should onChange be blocked until onStart completes?
  • How would it work with persistent triggers?, i.e. Would we only trigger onStart and never trigger onChange?
@gajus gajus added the enhancement New feature or request label Apr 10, 2023
@gajus
Copy link
Owner Author

gajus commented Apr 10, 2023

FYI @hyldmo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant