-
-
Notifications
You must be signed in to change notification settings - Fork 530
Add examples/ folder for openapi-fetch #1310
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
Conversation
|
@@ -68,194 +68,24 @@ client.GET("/some-authenticated-url", { | |||
}); | |||
``` | |||
|
|||
## Caching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be slightly-controversial, but I removed the section on caching. I have a feeling like encouraging users to roll their own caching strategy in general is a bad idea. This should be replaced with more framework-specific examples that encourage good habits within your reactivity framework.
If a user is dedicated rolling their own client-side caching, then they probably aren’t the type to follow instructions 😄
|
||
If you need to work with promises, then just using `openapi-fetch` as-is will usually suffice. If you need promises + caching, then you’ll have to come up with a solution that fits your own custom usecase. | ||
|
||
## React Query |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this was just moved into packages/openapi-fetch/examples/react-query
Deploying with
|
Latest commit: |
7cac9ac
|
Status: | ✅ Deploy successful! |
Preview URL: | https://2922ff02.openapi-ts.pages.dev |
Branch Preview URL: | https://rq-example.openapi-ts.pages.dev |
Changes
To prepare for some upcoming expanded docs for openapi-fetch examples (e.g. #1125), add an
examples/
folder that moves the React Query example into, and shortens the docs. Overall this is a better experience seeing code in context.How to Review
Docs-only change.
Checklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)