Skip to content

Commit 275f2c8

Browse files
committed
Run yarn format to format all files
1 parent 2bf7829 commit 275f2c8

File tree

87 files changed

+3254
-2815
lines changed

Some content is hidden

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

87 files changed

+3254
-2815
lines changed

docs/api/createListenerMiddleware.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ To fix this, the middleware provides types for defining "pre-typed" versions of
488488
import { createListenerMiddleware, addListener } from '@reduxjs/toolkit'
489489
import type { RootState, AppDispatch } from './store'
490490

491-
declare type ExtraArgument = {foo: string};
491+
declare type ExtraArgument = { foo: string }
492492

493493
export const listenerMiddleware = createListenerMiddleware()
494494

errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242
"40": "maxPages for endpoint '' must be a number greater than 0",
4343
"41": "getPreviousPageParam for endpoint '' must be a function if maxPages is used",
4444
"42": "Duplicate middleware references found when creating the store. Ensure that each middleware is only included once."
45-
}
45+
}

examples/action-listener/counter/src/index.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5-
sans-serif;
3+
font-family:
4+
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
5+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12-
monospace;
11+
font-family:
12+
source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
1313
}
1414

1515
h1 {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5-
sans-serif;
3+
font-family:
4+
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
5+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12-
monospace;
11+
font-family:
12+
source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
1313
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5-
sans-serif;
3+
font-family:
4+
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
5+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12-
monospace;
11+
font-family:
12+
source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
1313
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
body {
22
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5-
sans-serif;
3+
font-family:
4+
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
5+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
66
-webkit-font-smoothing: antialiased;
77
-moz-osx-font-smoothing: grayscale;
88
}
99

1010
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12-
monospace;
11+
font-family:
12+
source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
1313
}
Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,105 @@
1-
import { screen, waitFor } from "@testing-library/react"
2-
import App from "./App"
3-
import { renderWithProviders } from "./utils/test-utils"
1+
import { screen, waitFor } from '@testing-library/react'
2+
import App from './App'
3+
import { renderWithProviders } from './utils/test-utils'
44

5-
test("App should have correct initial render", () => {
5+
test('App should have correct initial render', () => {
66
renderWithProviders(<App />)
77

88
// The app should be rendered correctly
99
expect(screen.getByText(/learn/i)).toBeInTheDocument()
1010

1111
// Initial state: count should be 0, incrementValue should be 2
12-
expect(screen.getByLabelText("Count")).toHaveTextContent("0")
13-
expect(screen.getByLabelText("Set increment amount")).toHaveValue(2)
12+
expect(screen.getByLabelText('Count')).toHaveTextContent('0')
13+
expect(screen.getByLabelText('Set increment amount')).toHaveValue(2)
1414
})
1515

16-
test("Increment value and Decrement value should work as expected", async () => {
16+
test('Increment value and Decrement value should work as expected', async () => {
1717
const { user } = renderWithProviders(<App />)
1818

1919
// Click on "+" => Count should be 1
20-
await user.click(screen.getByLabelText("Increment value"))
21-
expect(screen.getByLabelText("Count")).toHaveTextContent("1")
20+
await user.click(screen.getByLabelText('Increment value'))
21+
expect(screen.getByLabelText('Count')).toHaveTextContent('1')
2222

2323
// Click on "-" => Count should be 0
24-
await user.click(screen.getByLabelText("Decrement value"))
25-
expect(screen.getByLabelText("Count")).toHaveTextContent("0")
24+
await user.click(screen.getByLabelText('Decrement value'))
25+
expect(screen.getByLabelText('Count')).toHaveTextContent('0')
2626
})
2727

28-
test("Add Amount should work as expected", async () => {
28+
test('Add Amount should work as expected', async () => {
2929
const { user } = renderWithProviders(<App />)
3030

3131
// "Add Amount" button is clicked => Count should be 2
32-
await user.click(screen.getByText("Add Amount"))
33-
expect(screen.getByLabelText("Count")).toHaveTextContent("2")
32+
await user.click(screen.getByText('Add Amount'))
33+
expect(screen.getByLabelText('Count')).toHaveTextContent('2')
3434

35-
const incrementValueInput = screen.getByLabelText("Set increment amount")
35+
const incrementValueInput = screen.getByLabelText('Set increment amount')
3636
// incrementValue is 2, click on "Add Amount" => Count should be 4
3737
await user.clear(incrementValueInput)
38-
await user.type(incrementValueInput, "2")
39-
await user.click(screen.getByText("Add Amount"))
40-
expect(screen.getByLabelText("Count")).toHaveTextContent("4")
38+
await user.type(incrementValueInput, '2')
39+
await user.click(screen.getByText('Add Amount'))
40+
expect(screen.getByLabelText('Count')).toHaveTextContent('4')
4141

4242
// [Negative number] incrementValue is -1, click on "Add Amount" => Count should be 3
4343
await user.clear(incrementValueInput)
44-
await user.type(incrementValueInput, "-1")
45-
await user.click(screen.getByText("Add Amount"))
46-
expect(screen.getByLabelText("Count")).toHaveTextContent("3")
44+
await user.type(incrementValueInput, '-1')
45+
await user.click(screen.getByText('Add Amount'))
46+
expect(screen.getByLabelText('Count')).toHaveTextContent('3')
4747
})
4848

49-
it("Add Async should work as expected", async () => {
49+
it('Add Async should work as expected', async () => {
5050
const { user } = renderWithProviders(<App />)
5151

5252
// "Add Async" button is clicked => Count should be 2
53-
await user.click(screen.getByText("Add Async"))
53+
await user.click(screen.getByText('Add Async'))
5454

5555
await waitFor(() =>
56-
expect(screen.getByLabelText("Count")).toHaveTextContent("2"),
56+
expect(screen.getByLabelText('Count')).toHaveTextContent('2'),
5757
)
5858

59-
const incrementValueInput = screen.getByLabelText("Set increment amount")
59+
const incrementValueInput = screen.getByLabelText('Set increment amount')
6060
// incrementValue is 2, click on "Add Async" => Count should be 4
6161
await user.clear(incrementValueInput)
62-
await user.type(incrementValueInput, "2")
62+
await user.type(incrementValueInput, '2')
6363

64-
await user.click(screen.getByText("Add Async"))
64+
await user.click(screen.getByText('Add Async'))
6565
await waitFor(() =>
66-
expect(screen.getByLabelText("Count")).toHaveTextContent("4"),
66+
expect(screen.getByLabelText('Count')).toHaveTextContent('4'),
6767
)
6868

6969
// [Negative number] incrementValue is -1, click on "Add Async" => Count should be 3
7070
await user.clear(incrementValueInput)
71-
await user.type(incrementValueInput, "-1")
72-
await user.click(screen.getByText("Add Async"))
71+
await user.type(incrementValueInput, '-1')
72+
await user.click(screen.getByText('Add Async'))
7373
await waitFor(() =>
74-
expect(screen.getByLabelText("Count")).toHaveTextContent("3"),
74+
expect(screen.getByLabelText('Count')).toHaveTextContent('3'),
7575
)
7676
})
7777

78-
test("Add If Odd should work as expected", async () => {
78+
test('Add If Odd should work as expected', async () => {
7979
const { user } = renderWithProviders(<App />)
8080

8181
// "Add If Odd" button is clicked => Count should stay 0
82-
await user.click(screen.getByText("Add If Odd"))
83-
expect(screen.getByLabelText("Count")).toHaveTextContent("0")
82+
await user.click(screen.getByText('Add If Odd'))
83+
expect(screen.getByLabelText('Count')).toHaveTextContent('0')
8484

8585
// Click on "+" => Count should be updated to 1
86-
await user.click(screen.getByLabelText("Increment value"))
87-
expect(screen.getByLabelText("Count")).toHaveTextContent("1")
86+
await user.click(screen.getByLabelText('Increment value'))
87+
expect(screen.getByLabelText('Count')).toHaveTextContent('1')
8888

8989
// "Add If Odd" button is clicked => Count should be updated to 3
90-
await user.click(screen.getByText("Add If Odd"))
91-
expect(screen.getByLabelText("Count")).toHaveTextContent("3")
90+
await user.click(screen.getByText('Add If Odd'))
91+
expect(screen.getByLabelText('Count')).toHaveTextContent('3')
9292

93-
const incrementValueInput = screen.getByLabelText("Set increment amount")
93+
const incrementValueInput = screen.getByLabelText('Set increment amount')
9494
// incrementValue is 1, click on "Add If Odd" => Count should be updated to 4
9595
await user.clear(incrementValueInput)
96-
await user.type(incrementValueInput, "1")
97-
await user.click(screen.getByText("Add If Odd"))
98-
expect(screen.getByLabelText("Count")).toHaveTextContent("4")
96+
await user.type(incrementValueInput, '1')
97+
await user.click(screen.getByText('Add If Odd'))
98+
expect(screen.getByLabelText('Count')).toHaveTextContent('4')
9999

100100
// click on "Add If Odd" => Count should stay 4
101101
await user.clear(incrementValueInput)
102-
await user.type(incrementValueInput, "-1")
103-
await user.click(screen.getByText("Add If Odd"))
104-
expect(screen.getByLabelText("Count")).toHaveTextContent("4")
102+
await user.type(incrementValueInput, '-1')
103+
await user.click(screen.getByText('Add If Odd'))
104+
expect(screen.getByLabelText('Count')).toHaveTextContent('4')
105105
})

examples/query/react/infinite-queries/src/App.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { BrowserRouter, Link, Route, Routes, useLocation } from "react-router"
2-
import "./App.css"
1+
import { BrowserRouter, Link, Route, Routes, useLocation } from 'react-router'
2+
import './App.css'
33

4-
import { Outlet } from "react-router"
5-
import BidirectionalCursorInfScroll from "./features/bidirectional-cursor-infinite-scroll/BidirectionalCursorInfScroll"
4+
import { Outlet } from 'react-router'
5+
import BidirectionalCursorInfScroll from './features/bidirectional-cursor-infinite-scroll/BidirectionalCursorInfScroll'
66
import {
77
InfiniteScrollAbout,
88
InfiniteScrollExample,
9-
} from "./features/infinite-scroll/InfiniteScrollExample"
10-
import LimitOffsetExample from "./features/limit-offset/LimitOffsetExample"
11-
import { InfiniteScrollMaxPagesExample } from "./features/max-pages/InfiniteScrollMaxExample"
12-
import PaginationInfScrollExample from "./features/pagination-infinite-scroll/PaginationInfScrollExample"
13-
import { PaginationExample } from "./features/pagination/PaginationExample"
14-
import { FlatlistExample } from "./features/rn-flatlist/FlatlistExample"
9+
} from './features/infinite-scroll/InfiniteScrollExample'
10+
import LimitOffsetExample from './features/limit-offset/LimitOffsetExample'
11+
import { InfiniteScrollMaxPagesExample } from './features/max-pages/InfiniteScrollMaxExample'
12+
import PaginationInfScrollExample from './features/pagination-infinite-scroll/PaginationInfScrollExample'
13+
import { PaginationExample } from './features/pagination/PaginationExample'
14+
import { FlatlistExample } from './features/rn-flatlist/FlatlistExample'
1515

1616
const Menu = () => {
1717
return (

examples/query/react/infinite-queries/src/app/createAppSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { asyncThunkCreator, buildCreateSlice } from "@reduxjs/toolkit"
1+
import { asyncThunkCreator, buildCreateSlice } from '@reduxjs/toolkit'
22

33
// `buildCreateSlice` allows us to create a slice with async thunks.
44
export const createAppSlice = buildCreateSlice({

examples/query/react/infinite-queries/src/app/hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
// We disable the ESLint rule here because this is the designated place
55
// for importing and re-exporting the typed versions of hooks.
66
/* eslint-disable @typescript-eslint/no-restricted-imports */
7-
import { useDispatch, useSelector } from "react-redux"
8-
import type { AppDispatch, RootState } from "./store"
7+
import { useDispatch, useSelector } from 'react-redux'
8+
import type { AppDispatch, RootState } from './store'
99

1010
// Use throughout your app instead of plain `useDispatch` and `useSelector`
1111
export const useAppDispatch = useDispatch.withTypes<AppDispatch>()

0 commit comments

Comments
 (0)