-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix issues 1980 and 2003 #2058
fix issues 1980 and 2003 #2058
Conversation
I am thinking about reverting the merged V5 PR so it's not accidentally published and breaks things. At least until a solution is discovered. Or can you @haimrait prepare a PR with added test and fix? |
Good job, if you could add one more test it would be excellent: test("#1980 .replace should not report changed unnecessarily", () => {
const mapArray = [["swappedA", "swappedA"], ["swappedB", "swappedB"], ["removed", "removed"]];
const replacementArray = [mapArray[1], mapArray[0], ["added", "added"]];
const map = observable.map(mapArray)
let autorunInvocationCount = 0;
autorun(() => {
map.get("swappedA");
map.get("swappedB");
autorunInvocationCount++;
});
map.replace(replacementArray);
expect(Array.from(map.entries())).toEqual(replacementArray);
expect(autorunInvocationCount).toBe(1);
}) |
@mweststrate When/if you will have a time, could you take a look whether there is a particular reason for using observable |
From the top of my head there isn't, I think this just evolved over time
and the implications could be the same in this regard. If making it the
same still passes the tests, feel free to go ahead 😊
Op za 3 aug. 2019 11:38 schreef urugator <notifications@github.com>:
… @mweststrate <https://github.com/mweststrate> When/if you will have a
time, could you take a look whether there is a particular reason for using
observable keys array rather than keysAtom in v4?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2058?email_source=notifications&email_token=AAN4NBDHYOMZJLDCWF5VK6LQCVGZZA5CNFSM4IG47UOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3PLDMY#issuecomment-517910963>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN4NBENYLKUUD3XOMMXGITQCVGZZANCNFSM4IG47UOA>
.
|
sure |
Fix issues 1980 and 2003