We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/charleyw/wechat-weapp-redux/blob/master/src/connect.js#L32
这里shallowEquall 感觉工作不了的,小程序的setData 会把数据复制一份(方便传输到视图层),也就是说这个判断理论上是不可能成立的。
The text was updated successfully, but these errors were encountered:
好吧,我说得清楚点:
const test = { foo: 'bar' } // 在小程序里 this.setData({ test }) this.data.test === test // 恒为false
因为setData 是把数据深拷贝一份(传输到视图层)再设置到data 上的,所以shallowEqual 在这里是不能工作的,因为每次shallowEqual 比较的都是不同的对象了。
就算不考虑上述因素,shallowEqual(this.data, mappedState) 这里,this.data 不是包含了很多自己的属性吗?Object.keys(this.data) 和Object.keys(mappedState) 都不相等了,shallowEquall 不还是每次都是false 吗
Sorry, something went wrong.
我也发现这个问题.. 而且这个库没有类似 onStateChange的功能
No branches or pull requests
https://github.com/charleyw/wechat-weapp-redux/blob/master/src/connect.js#L32
这里shallowEquall 感觉工作不了的,小程序的setData 会把数据复制一份(方便传输到视图层),也就是说这个判断理论上是不可能成立的。
The text was updated successfully, but these errors were encountered: