You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@davidkpiano we ran across another issue that seems related.
It appears that calling provide after extending with a higher-level machine function reverts to the previous machines' logic.
constmachine=createMachine()constmachineWithLogging=withLogging(machine)machineWithLogging.provide()// returns to old behavior without logging
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: