-
Notifications
You must be signed in to change notification settings - Fork 729
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
Unable to get the latest value of state
inside of clickListener block
#1047
Comments
This sounds like behavior relating to One thing that comes to mind is that there is a bug with incremental annotation processing where the package config setting may not take affect if you put the annotation on a package-info element, and in the newly released 4.0.0 you must put the annotation on an interface or class to avoid that bug |
We never configured anything related to
We've done this step when we were migrating from 3.8.0 to 4.0.0-beta6.
For the case on the code sample above #1047 (comment), actually I've managed to solve it by using But still, this is weird for us because it worked perfectly fine before (when we're still using 3.8.0). |
If you want the captured references to update, you need to disable that behavior (https://github.com/airbnb/epoxy/wiki/DoNotHash) I'm not sure why it would have changed for you in the version update. The only thing I can think of is that perhaps there was a bug that didn't correctly implement the behavior or configuration before, but what you are describing now seems like correct behavior |
I found this PR #837 which got included in 3.9.0 (https://github.com/airbnb/epoxy/releases/tag/3.9.0), where it fixed the reading of Thanks for your help @elihart ! Really appreciate it. |
We use data binding for generating Epoxy models, usually with
clickListener
. We put a logic block inside theclickListener
to decide what action needs to be done. This logic block uses astate
which comes from somewhere outside thewithModels
block.This approach used to work very well for us in Epoxy v3.8.0, but after we update to v4.0.0-beta6, suddenly anytime the code inside
clickListener
is being executed, thestate
is reset to the initial value (instead of the latest one).In the above code, anytime
state.editMode
is being accessed insideclickLister { }
, it always returnsfalse
even though the actual value has been updated totrue
.Are there any changes from v3.8.0 to v4.0.0-beta6 that I am not aware of?
The text was updated successfully, but these errors were encountered: