-
Notifications
You must be signed in to change notification settings - Fork 408
Ensure array items are returned in the correct order #41
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
Conversation
…e populated in order which query specifies
|
Also, quick note: it's unclear how to package up a forked npm distribution for use in our package.json files. I ended up trying to commit the dist directory (f8b47c6) but that also didn't work. |
|
Hey @morgante - I don't think this actually fixes the problem. In your code, As for the the npm issue, this is intentional. We don't really want people working off of a non-released branch as that leads to a huge support headache for us. We only support official releases. I wouldn't even suggest using the |
|
@jwngr I'm not sure I follow. We build It's unfortunate that you don't support people working on a non-released branch. I definitely understand why you would not want everyone doing so, but as of now this is blocking a release for us. |
|
Sorry that you are blocked on this. In your fork, you can add the What does your data look like that is working? If we have an object like this: Then converting that to an object via While this might print out |
|
Interesting. I can see how we could use |
|
Everything in Firebase is technically an object. Arrays are just objects with keys like |
|
So, to answer your question, the |
|
Okay, that clarifies things further—I thought we had to support ordering for both bindings, but we only have to do it for If that's true, I'd be happy to rewrite this PR quickly to actually build up an array from within the forEach. |
|
Yup, just for |
|
This was superseded by #43. I went with a more complex and complete fix for this issue. Thanks again for taking a crack at this. |
|
This is not working correctly when using orderByChild(). I can see that you only have tests for orderByValue. |
|
I just added tests for It's odd that What versions of ReactFire and Firebase are you using? Does upgrading them to the latest fix the problem at all? Also, please open a new issue if you think you've found a new bug. This is a PR and was not even merged in. Thanks! |
This pull request fixes #36 by using the
DataSnapshot.forEachmethod to build up an array before passing it to React. This ensures that arrays are sent to React in the order which the query specified.