-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Resource clones can't be used at the same time #6208
Comments
The reason is that The |
Either of those options sounds good -- I know it's a new class and the API is probably not set in stone just yet. I mentioned a few similar (small) things in #6205 . I don't expect it any time soon but maybe an example (blog post or Sandcastle) showing a few use cases for Resource would help clarify? |
Fixed with #6211 |
Read this comment then consider this code:
Currently, this will spew a bunch of errors on the console, "resource is already being fetched". It violates the expectation that in
all three resources could be used interchangeably. This is not true, because r1 and r2 can run at the same time, but r1 and r3 cannot.
I'm not totally clear on what the comment means about "breaking the request scheduler", so I'm sure there are implications to consider, but on the face of it, I think
clone()
needs to always make a new Request. If it isn't going to make a new one, the docs need to carefully explain the implications ofclone()
, and describe how a clone is different from a first-class Resource.In the short term,
getDerivedResource({})
(note the empty object as sole argument) is basically a drop-in replacement for how I expectedclone()
to work.The text was updated successfully, but these errors were encountered: