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

noAutoDestroy should seamlessly continue #84

Closed
rkuhn opened this issue Nov 23, 2023 · 2 comments · Fixed by #85
Closed

noAutoDestroy should seamlessly continue #84

rkuhn opened this issue Nov 23, 2023 · 2 comments · Fixed by #85

Comments

@rkuhn
Copy link
Member

rkuhn commented Nov 23, 2023

Currently, the following code will block for the next live state:

const machine = createMachineRunner(...)
await machine.peek()
for await (const state of machine.noAutoDestroy()) {
  ...
}

Instead, the state stored as a result of peek() should be immediately delivered.

Up for discussion: this method is useful for sharing a machine owned by a cache with the application, but it would be even easier if it returned a full machine instead of just the next() and peek() methods.

@Kelerchian
Copy link
Contributor

@rkuhn Per the last version, that is already the case. I vaguely remember a bug that precisely affected this

@Kelerchian
Copy link
Contributor

#85 is only an additional test case that asserts this particular case

Kelerchian added a commit that referenced this issue Nov 23, 2023
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 a pull request may close this issue.

2 participants