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

[bug?] Nested machines immediate issue #195

Open
kybarg opened this issue Feb 24, 2021 · 1 comment
Open

[bug?] Nested machines immediate issue #195

kybarg opened this issue Feb 24, 2021 · 1 comment

Comments

@kybarg
Copy link
Contributor

kybarg commented Feb 24, 2021

When using invoke to run nested machines current doenst't represent deepest child

Here is example
https://codesandbox.io/s/react-robot-bug-example-re781

robot/machine.js

Lines 174 to 181 in 31d8125

let service = {
send(event) {
this.machine = send(this, event);
// TODO detect change
this.onChange(this);
}
};

this quick fix helped, but this looks wrong😁

let service = {
  send(event) {
    this.machine = send(this, event);

    // TODO detect change
-    this.onChange(this);
+    this.onChange(this.child || this)
  }
};
@kybarg kybarg changed the title Nested machines immediate issue [bug?] Nested machines immediate issue Feb 24, 2021
@matthewp matthewp transferred this issue from matthewp/robot-hooks Feb 2, 2023
@afn
Copy link

afn commented Sep 18, 2023

This appears to remain an issue in the latest version (0.4.0).

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

No branches or pull requests

2 participants