You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, not sure what's going on this seems a bit too specific for stackoverflow so I'll try here.
Description:
Basically I have a store (ProductStore) that holds information about products in different variants, described by their format (folding) and color. The store has only one @observable currentVariantId that tracks which product variant is currently chosen. Whole bunch of @computed values are directly and indirectly derived from that observable.
What's (maybe) important is that I'm not injecting this store with @Inject but creating a new one for each Product component in its constructor. When user clicks buttons to change formats or colors, information in the store should automatically change.
Issue:
Everything works fine up to the point when in my component's function handleFoldingChange which calls an action on the store, after firing the action I accessed the value it is supposed to change. Suddenly, seemingly unrelated @computed functions (availableColors) stopped firing.
Reproduction:
The whole thing is fairly complicated and specific, but I've made a smaller reproduction here: https://jsfiddle.net/g7fpudq0/4/. If you click any of the buttons it will randomly change a format or color, and it will show that other variable like variant and availableColors update accordingly, but when you uncomment the lines under TODO: in handleFoldingChange, the behavior changes and values are no longer automatically updated.
Sorry for the long issue, but I'm at a complete loss here, any help is greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
Seems like bug ... the computed with transitive dependency becomes stale when (one of the) computed is accessed outside of actionhere is simplified reproduction
The problem is probably caused by observer, because I wasn't able to reproduce the issue with autorun alone and moreover, creating additional autorun "fixes" the staleness problem inside observer as demonstated in reproduction.
Hi, not sure what's going on this seems a bit too specific for stackoverflow so I'll try here.
Description:
Basically I have a store (ProductStore) that holds information about products in different variants, described by their format (folding) and color. The store has only one @observable currentVariantId that tracks which product variant is currently chosen. Whole bunch of @computed values are directly and indirectly derived from that observable.
What's (maybe) important is that I'm not injecting this store with @Inject but creating a new one for each Product component in its constructor. When user clicks buttons to change formats or colors, information in the store should automatically change.
Issue:
Everything works fine up to the point when in my component's function
handleFoldingChange
which calls an action on the store, after firing the action I accessed the value it is supposed to change. Suddenly, seemingly unrelated @computed functions (availableColors
) stopped firing.Reproduction:
The whole thing is fairly complicated and specific, but I've made a smaller reproduction here: https://jsfiddle.net/g7fpudq0/4/. If you click any of the buttons it will randomly change a format or color, and it will show that other variable like variant and availableColors update accordingly, but when you uncomment the lines under
TODO:
inhandleFoldingChange
, the behavior changes and values are no longer automatically updated.Sorry for the long issue, but I'm at a complete loss here, any help is greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: