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

Incorrect merge behavior for data with existing sections #98

Open
Oxyaction opened this issue Apr 7, 2017 · 0 comments · May be fixed by #99
Open

Incorrect merge behavior for data with existing sections #98

Oxyaction opened this issue Apr 7, 2017 · 0 comments · May be fixed by #99

Comments

@Oxyaction
Copy link
Contributor

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.

Oxyaction added a commit to Oxyaction/react-native-gifted-listview that referenced this issue Apr 7, 2017
@Oxyaction Oxyaction linked a pull request Apr 7, 2017 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant