-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Methods like provide
are lost when implementing Higher Level Actor Logic
#4868
Comments
@davidkpiano we ran across another issue that seems related. const machine = createMachine()
const machineWithLogging = withLogging(machine)
machineWithLogging.provide() // returns to old behavior without logging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug or feature request?
It would be great to have a more robust way of extending existing machines/actors.
Description:
Hello 👋 , something we noticed in the doc for higher-level-actor-logic
The spread operator is used to preserve the original actor logic.
Doing this seems to drop the original prototype information so methods like
provide
go missing.(Bug) Expected result:
When using a higher-order function to extend a machine, I would expect all types and original prototype methods to pass through.
i.e this should type correctly, and the function should be present.
(Bug) Actual result:
provide
is not a function(Bug) Potential fix:
Instead of this
We ended up with this to preserve those methods.
Also, shout out to @wfischer42 on our team at Discern.
He's the one who implemented this fix.
The text was updated successfully, but these errors were encountered: