-
Notifications
You must be signed in to change notification settings - Fork 88
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
Concurrent call on CRUD endpoint issue #158
Comments
Hello @divan you can't update state concurrently. In you case post request return poor json response like |
I am encountering this issue as well. What is the correct way to handle this case? One component that pulls rest data for individual records using the crud helpers. For example addresses. You need to display an origin and destination, but the api endpoint is the same. How can I hook in to use the redux-api concept? Right now, both addresses show the same data even though they fetch different ids from the remote server
Is it possible to keep a cached array of the last X responses? Then in select state the address can be picked by ID or refetched? |
for now directly using request works but doesn't give a way to update on change
|
Hi,
I'm not sure I can quickly create reproducible example, but here is the case.
I have an endpoint defined:
registrations: { url: `/api/registrations`, crud: true, transformer: transformers.array },
In one place I'm using get() to get the data:
(the original code was simpler, I was simply using props.registration.data, but then, investigating this issue, created this)
In another place (modal window) I do POST request for this endpoint:
So, when POST request happens, data for the first GET request is also changed.
In fact I see in console log this:
Note, that after POST request there is no "Getting data..." log entry. It looks like callback from the first action dispatch got called automagically by itself after POST request.
Any idea what I'm doing wrong here?
The text was updated successfully, but these errors were encountered: