Thursday 15 August 2013

javascript - Does the KnockoutJS observableArray do a diff between old and new array before notifying subscribers? -


I am using the KnockoutJS library and I can not understand one thing: Knock OutJS Overview If it was updated with a different array that contains the exact same value (for example the copy of the old array)?

The answer is that it does not check the array in any way before informing the subscriber is. Known Out includes a utility function, ko.utils.compareArrays , which compares two arrays and returns the difference internally by ko.utils.setDomNodeChildrenFromArrayMapping Used, which in turn is used by the foreach binding.

No comments:

Post a Comment