Open vitch opened 5 years ago
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...
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?