Skip to content
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

There is an error in the areStatesEqual method #515

Open
Qiu800820 opened this issue Mar 18, 2022 · 0 comments
Open

There is an error in the areStatesEqual method #515

Qiu800820 opened this issue Mar 18, 2022 · 0 comments

Comments

@Qiu800820
Copy link

Qiu800820 commented Mar 18, 2022

areStatesEqual

test case:

state = {name: 'test', params: {a: 1, b: undefined}};
state2 =  {name: 'test', params: {a: 1, c: 2}};
console.log(areStatesEqual(state, state2, false));

expect: false
reality: true

state.params['a'] === state2.params['a'] ✅
state.params['b'] === state2.params['b'] ✅
state.params['c'] === state2.params['c'] ❌

bug line:

state1Params.length === state2Params.length && 
state1Params.every(p => state1.params[p] === state2.params[p])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant