-
Notifications
You must be signed in to change notification settings - Fork 53
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
Calling transition on child object with intialize
transition does not return parent microstate
#291
Comments
intialize
transition does not return parent microstate
Hi @brandynbennett, thank you for catching another bug for us. I was able to reproduce this in runkit https://runkit.com/taras/initialization-test. It's highlighting area of functionality where we don't have sufficient test coverage. While we sort this out, you can use const { create, valueOf } = require('microstates');
class Pagination {
page = create(Number, 1)
itemsPerPage = create(Number, 25)
}
class Table {
pagination = Pagination
}
let table = create(Table);
table.pagination.page.set(5) instanceof Table
//> true You can see it working here https://runkit.com/taras/initialization-test-create-default-value |
Awesome @taras Thanks for the pointer. |
Here is a branch with a failing case for this use case tm/initializing-nested-node |
Has there been any progress on this issue? |
We're still working on it, but it is definitely a priority. I'd expect a solution in the next two weeks. |
Given a child class with an
initialize
transitionand a parent class that uses it
Calling a transition on the child property returns the child property not the parent property:
You can see an example here: https://codesandbox.io/s/y7v1v8op8j
The text was updated successfully, but these errors were encountered: