react-native-gifted-listview
react-native-gifted-listview copied to clipboard
Incorrect merge behavior for data with existing sections
Current implementation of MergeRecursive
function works incorrectly when loading a new page with header that already exists, new data completely overwrites old.
Consider the following example:
const a = { monday: ['a', 'b', 'c'] };
const b = { monday: ['d', 'e'], tuesday: ['f'] };
MergeRecursive(a, b);
gives
{ monday: [ 'd', 'e' ], tuesday: [ 'f' ] }
instead of expected
{ monday: ['a', 'b', 'c', 'd', 'e' ], tuesday: [ 'f' ] }
so to get this feature work correctly we need either prefetch all pages before current too, which
is totally inefficient of course or to merge new data with old before passing it to the callback
which is not so convenient.