Skip to content

Return dispatch #1018

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

Merged
merged 1 commit into from
Jan 25, 2021
Merged

Return dispatch #1018

merged 1 commit into from
Jan 25, 2021

Conversation

zaceno
Copy link
Contributor

@zaceno zaceno commented Jan 25, 2021

This PR does two things:

  • It makes app() return the internal dispatch so it could be used by external utilities, for e g dev tooling
  • It makes it so if you ever dispatch with no arguments (wether with the returned function, or in an effect, or return void from an action) it will stop the app

Stopping an app means:

  • future calls to dispatch do nothing.
  • all possible active subscriptions are stopped
  • the DOM is not touched. It remains exactly as it was before the app was stopped.

@zaceno zaceno mentioned this pull request Jan 25, 2021
@jorgebucaran jorgebucaran added the enhancement New feature or request label Jan 25, 2021
@jorgebucaran jorgebucaran merged commit d97b79e into jorgebucaran:main Jan 25, 2021
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

Successfully merging this pull request may close these issues.

2 participants