First of all, thanks for a great and easy to use library.
I'm having some trouble using the meta from an API endpoint to order an array. I have an ordered array returned from a particular API endpoint, which I'm saving the metadata in data -> meta -> (endpoint)
If I make a call that returns four unique values, I get the order saved in data -> meta -> (endpoint) as expected, and the items themselves are saved as a list in the rest of the redux store ("q" in this example).
This works great. However, when I make the same call later on, I want to remove one item from the list based on the API response. The API call only returns 3 items in this next response, the ones starting with ID d4208..., 07988..., and e8368...
The one starting with 31ad7.. is correctly gone from the meta, but e8368... is there twice now.
I'm writing to the store with something like this: return Object.assign({}, normalize(res.data, { endpoint }));. Screenshots are from Redux Devtools Chrome Extension with irrelevant parts blacked out
Is this expected? I'd like to override the meta from each API path if possible. The API calls are the same exact path in both screenshots (including the blacked out part).
Please let me know if more info is needed and thanks again!
Nevermind. I was following this example, which merges everything. Was incorrectly expecting this library to override meta endpoints based on responses (which kind of seems useful for ordering).
First of all, thanks for a great and easy to use library.
I'm having some trouble using the meta from an API endpoint to order an array. I have an ordered array returned from a particular API endpoint, which I'm saving the metadata in data -> meta -> (endpoint)
If I make a call that returns four unique values, I get the order saved in data -> meta -> (endpoint) as expected, and the items themselves are saved as a list in the rest of the redux store ("q" in this example).
This works great. However, when I make the same call later on, I want to remove one item from the list based on the API response. The API call only returns 3 items in this next response, the ones starting with ID
d4208...
,07988...
, ande8368...
The one starting with
31ad7..
is correctly gone from the meta, bute8368...
is there twice now.I'm writing to the store with something like this:
return Object.assign({}, normalize(res.data, { endpoint }));
. Screenshots are from Redux Devtools Chrome Extension with irrelevant parts blacked outIs this expected? I'd like to override the meta from each API path if possible. The API calls are the same exact path in both screenshots (including the blacked out part).
Please let me know if more info is needed and thanks again!