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

too much recursion when calling a custom transition #172

Open
vitch opened this issue Sep 17, 2019 · 1 comment
Open

too much recursion when calling a custom transition #172

vitch opened this issue Sep 17, 2019 · 1 comment
Labels

Comments

@vitch
Copy link

vitch commented Sep 17, 2019

An example is worth a thousand words so I put together a reproduction:
https://codesandbox.io/s/microstates-jgdhu

I sum up the issue in the comments there but basically calling a custom transition on a microstate is causing an infinite recursion error. I think because the action in question is still pointing to a previous revision of the microstate. But I'm not sure how to avoid this happening or if Glimmer should have known to re-compute the action when the state was updated?

@vitch
Copy link
Author

vitch commented Sep 18, 2019

To be more explicit in case the code sandbox is unavailable, given the following setup:

https://gist.github.com/vitch/d8edb1b5d4895daf944cf5f086454d28

Where tabManager is {{#let (state (type "tab-manager") this.model) as |tabManager|}} the following code works once:

onclick={{action tabManager.activateTab tab}}

But running it a second time fails - I think because tabManager in the action is still pointing to the original instance of the microstate while it should have been updated to the new microstate...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant