Skip to content
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

pass the ThunkArg to the idGenerator function #1600

Merged
merged 5 commits into from
Oct 17, 2021
Merged

pass the ThunkArg to the idGenerator function #1600

merged 5 commits into from
Oct 17, 2021

Conversation

loursbourg
Copy link
Contributor

@loursbourg loursbourg commented Oct 9, 2021

While working on a global error handling reducer where i needed to generate a unique ID for each outgoing
request, there were cases where the url itself changes based some parameters so the final url looks something
like this:
https://...../users/${ID}/add-to-favorite
and if, say you want to spin a loader for a specific item in a list of let's say 10 paginated items, you will actually
need to somehow uniquely identify which request belongs to which item, but if you could pass the thunkArg to
the request generator function you can easily then generate requestIds based on it, so that when you call
the idGenerator with a given id, it produces a "hash-like" representation of it.

@netlify
Copy link

netlify bot commented Oct 9, 2021

✔️ Deploy Preview for redux-starter-kit-docs ready!

🔨 Explore the source changes: 56ec553

🔍 Inspect the deploy log: https://app.netlify.com/sites/redux-starter-kit-docs/deploys/616bce893db31400082416a9

😎 Browse the preview: https://deploy-preview-1600--redux-starter-kit-docs.netlify.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 9, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 56ec553:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration

@phryneas
Copy link
Member

Sorry that I got back to this so late - I'm completely swamped at the moment.

This looks good - can you also add docs changes and a test maybe?

@phryneas phryneas modified the milestones: 1.8, 1.7 Oct 16, 2021
@loursbourg
Copy link
Contributor Author

Done!

Copy link
Member

@phryneas phryneas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :)

@phryneas phryneas changed the base branch from master to v1.7.0-integration October 17, 2021 06:59
@phryneas phryneas merged commit 06d6f12 into reduxjs:v1.7.0-integration Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants