Closed azappella closed 7 years ago
Thanks!
The normalizr schema we use for the async example uses arrayOf
for normalizing the subreddit posts: https://github.com/amplitude/redux-query/blob/e8459abdfc55515a3e79c812723aafa9f470863a/examples/async/containers/App.js#L101
If you look at the console, you can see how the posts are stored as a list of IDs inside the reddits
entities. This list determines the order and each ID can be mapped to a post in the posts
entity:
Please correct me if I am misunderstanding your question. :)
Yes, thank you for your response!
Hi there,
First off, thanks for the library!
Given that your Async Example uses normalizr, I thought my question might be relevant. Normalizr uses the "result" key to maintain the order of the data that is normalized. Using redux-query, how would you maintain that ordering without somehow passing/storing the "result" object? In your example, you only pass the "entities" down, so it seems the ordering is lost. I guess it would be up to the user to somehow store that result object or reorder the entities in the transform method before passing them further:
For reference: https://github.com/paularmstrong/normalizr/issues/9
From the redux without profanity book:
Thanks & hope it's somewhat relevant.