Skip to content

Commit 52e826f

Browse files
authored
Merge pull request #2219 from sidwebworks/master
2 parents 9e6d3c3 + 036c55e commit 52e826f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2199
-15
lines changed

docs/rtk-query/usage/examples.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,24 @@ We have a variety of examples that demonstrate various aspects of using RTK Quer
1616

1717
These examples are not meant to be what you base your application on, but exist to show _very specific_ behaviors that you may not actually want or need in your application. For most users, the basic examples in the [Queries](./queries) and [Mutations](./mutations) sections will cover the majority of your needs.
1818

19-
:::info
20-
21-
The examples were created as part of the standalone `@rtk-incubator/rtk-query` development cycle. We're currently working to update them as part of the process of finalizing RTK Query's integration into Redux Toolkit, so some of the imports are mismatched and not all the examples are currently in the RTK repo. However, you should be able to inspect these examples and use the logic they show as guidelines.
22-
23-
:::
24-
2519
:::tip
2620

2721
Please note that when playing with the examples in CodeSandbox that you can experience quirky behavior, especially if you fork them and start editing files. Hot reloading, CSB service workers and [`msw`](https://mswjs.io/) sometimes have trouble getting on the right page -- when that happens, just refresh in the CSB browser pane.
2822

2923
:::
3024

31-
## React Hooks
25+
## Kitchen Sink
3226

3327
<iframe
34-
src="https://codesandbox.io/embed/rtk-query-demo-lbp7n?fontsize=12&hidenavigation=1&theme=dark&runonclick=1"
28+
src="https://codesandbox.io/embed/github/reduxjs/redux-toolkit/tree/master/examples/query/react/kitchen-sink?fontsize=12&hidenavigation=1&theme=dark&runonclick=1"
3529
style={{
3630
width: '100%',
3731
height: '800px',
3832
border: 0,
3933
borderRadius: '4px',
4034
overflow: 'hidden',
4135
}}
42-
title="RTK Query React Hooks Example"
36+
title="RTK Query Kitchen Sink Example"
4337
allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb"
4438
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
4539
></iframe>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SKIP_PREFLIGHT_CHECK=true
2+
NODE_ENV=development
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "@examples-query-react/kitchen-sink",
3+
"private": true,
4+
"version": "1.0.0",
5+
"description": "getting-started-hooks",
6+
"keywords": [],
7+
"main": "src/index.tsx",
8+
"dependencies": {
9+
"@reduxjs/toolkit": "1.8.1",
10+
"msw": "^0.39.2",
11+
"react": "17.0.0",
12+
"react-dom": "17.0.0",
13+
"react-redux": "7.2.2",
14+
"react-router-dom": "5.3.0",
15+
"react-scripts": "4.0.2"
16+
},
17+
"devDependencies": {
18+
"@testing-library/jest-dom": "^5.11.5",
19+
"@testing-library/react": "^12.0.0",
20+
"@types/jest": "^26.0.23",
21+
"@types/node": "^14.14.6",
22+
"@types/react": "17.0.0",
23+
"@types/react-dom": "17.0.0",
24+
"@types/react-redux": "7.1.9",
25+
"typescript": "~4.2.4",
26+
"whatwg-fetch": "^3.4.1"
27+
},
28+
"eslintConfig": {
29+
"extends": [
30+
"react-app"
31+
],
32+
"rules": {
33+
"react/react-in-jsx-scope": "off"
34+
}
35+
},
36+
"scripts": {
37+
"start": "react-scripts start",
38+
"build": "react-scripts build",
39+
"test": "react-scripts test --runInBand"
40+
},
41+
"browserslist": [
42+
">0.2%",
43+
"not dead",
44+
"not ie <= 11",
45+
"not op_mini all"
46+
],
47+
"msw": {
48+
"workerDirectory": "public"
49+
}
50+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<meta name="theme-color" content="#000000">
8+
<!--
9+
manifest.json provides metadata used when your web app is added to the
10+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
11+
-->
12+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
13+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
14+
<!--
15+
Notice the use of %PUBLIC_URL% in the tags above.
16+
It will be replaced with the URL of the `public` folder during the build.
17+
Only files inside the `public` folder can be referenced from the HTML.
18+
19+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
20+
work correctly both with client-side routing and a non-root public URL.
21+
Learn how to configure a non-root public URL by running `npm run build`.
22+
-->
23+
<title>React App</title>
24+
</head>
25+
26+
<body>
27+
<noscript>
28+
You need to enable JavaScript to run this app.
29+
</noscript>
30+
<div id="root"></div>
31+
<!--
32+
This HTML file is a template.
33+
If you open it directly in the browser, you will see an empty page.
34+
35+
You can add webfonts, meta tags, or analytics to this file.
36+
The build step will place the bundled scripts into the <body> tag.
37+
38+
To begin the development, run `npm start` or `yarn start`.
39+
To create a production bundle, use `npm run build` or `yarn build`.
40+
-->
41+
</body>
42+
43+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"short_name": "RTK Query Authentication using extraReducers Example",
3+
"name": "Authentication Example",
4+
"start_url": ".",
5+
"display": "standalone",
6+
"theme_color": "#000000",
7+
"background_color": "#ffffff"
8+
}

0 commit comments

Comments
 (0)