Closed pdegand closed 2 years ago
Yep, looks like a bug! I'd be happy to review a bug fix.
Please start by modifying the onDidChange
test case to demonstrate this problem & make the test fail. Then, implement the suggested fix to make sure the test passes as expected. That will ensure we have proper test coverage so this bug doesn't happen again in the future in case of future bug fixes or improvements.
Thanks again for the report. I've created #234 to fix the issue.
Version 0.10.0 fixes this bug and has support for Flutter 3. Please let me know if you spot any more problems!
Hi,
After trying to compare the old VM and the new VM in
onDidChange
to trigger some animations, I realized that the code ofonDidChange
is probably wrong.Here is the code of
handleChange
annotated to illustrate where I think the implementation is wrong :To easily reproduce this bug, you can edit the counter sample, add a
onDidChange
callback to the StoreConnector that simply logs the old and the new VM :And here is the log result with this modification :
We should expect to have the old value to be always 1 less than the new value.
If this is indeed a bug, I can submit a PR with a fix.