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

Docs: Add simpler Basic Usage example for createListener Middleware (suggestion) #4836

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kostasx
Copy link
Contributor

@kostasx kostasx commented Jan 29, 2025

I find the Basic Usage example way too convoluted and definitely not Basic. I suggest this is split into a very simple version for setting up and dispatching an action (I tried to keep it as simple as possible) and an extended version with some of the other options available.

I've also included another listener on the extended version.

P.S. Up to the team and the community to decide, but I find myself in trouble whenever I need to reach out for a very basic setup in order to implement a listener in my code.

Copy link

codesandbox bot commented Jan 29, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

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 17c73e4:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

Copy link

netlify bot commented Jan 29, 2025

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

Name Link
🔨 Latest commit 17c73e4
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/679a6a585c13ca0008a01ddf
😎 Deploy Preview https://deploy-preview-4836--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@markerikson
Copy link
Collaborator

Is your concern around the setup part (createListenerMiddleware(), getDefaultMiddleware.concat(listenerMiddleware.middleware)? Or the "things you can do inside the effect callback" part?

@kostasx
Copy link
Contributor Author

kostasx commented Jan 29, 2025

Mostly the effect callback contents. The setup part, is mandatory for a basic example, I guess.

@kostasx
Copy link
Contributor Author

kostasx commented Jan 29, 2025

For a basic example, I think, all the things inside the callback are a bit too much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants