ember icon indicating copy to clipboard operation
ember copied to clipboard

too much recursion when calling a custom transition

Open vitch opened this issue 4 years ago • 1 comments

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 avatar Sep 17 '19 18:09 vitch

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...

vitch avatar Sep 18 '19 10:09 vitch