Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

new util: MdModelComparator #1608

Open
VdustR opened this issue Mar 16, 2018 · 0 comments
Open

new util: MdModelComparator #1608

VdustR opened this issue Mar 16, 2018 · 0 comments
Assignees

Comments

@VdustR
Copy link
Member

VdustR commented Mar 16, 2018

All components have selection could call the function to check the value or array is changed or not, including MdSelect, MdTable, MdRadio.

for single comparing, there will be a method compare(a, b) followed these rules:

undefined = null
null != 0 != NaN != '' != false
0 = '0', 1 = '1', ...
any non-object-value != any object, an object != another object
for multiple comparing, I want to implement a method compareArray(a, b) followed these rules:

[] = null = undefined
regarding sorting,['a', 'b'] = ['b', 'a'].
including objects, [a, b] = [b, a]. I'll using find index to implement that.
values in array follow single comparing rule, like: [null] = [undefined]
These rules will be wrote in documentation to let developers know how it work.

Issue from #1585 (comment)

@VdustR VdustR self-assigned this Mar 16, 2018
@VdustR VdustR changed the title MdModelComparator new util: MdModelComparator Mar 16, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant