Skip to content

Commit 6187075

Browse files
authored
Merge pull request #91 from MattCCC/react-hook
SWR Support + React hook + Stability improvements
2 parents f22ebe9 + f394c55 commit 6187075

Some content is hidden

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

70 files changed

+19239
-4494
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
node: ["18.x", "20.x", "22.x"]
10+
node: ['18.x', '20.x', '22.x', '24.x']
1111
os: [ubuntu-latest, macOS-latest]
1212

1313
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,6 @@ package/
110110

111111
dist/*.ts
112112
dist/**/*.ts
113+
dist/**/*.mts
113114
!dist/*.map
114115
!dist/**/*.map

README.md

Lines changed: 1960 additions & 337 deletions
Large diffs are not rendered by default.

docs/examples/examples.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ async function example3() {
136136
}
137137

138138
// Overwrite response of existing endpoint
139-
const { data: book1 } = await api.fetchBook<NewBook>(
140-
{ newBook: true },
139+
const { data: book1 } = await api.fetchBook<NewBook, BookQueryParams>({
140+
params: { newBook: true },
141141
// @ts-expect-error should verify that bookId cannot be text
142-
{ bookId: 'text' },
143-
);
142+
urlPathParams: { bookId: 'text' },
143+
});
144144

145145
// Overwrite response and query params of existing endpoint
146146
const { data: book11 } = await api.fetchBook<NewBook, NewBookQueryParams>({

jest.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,14 @@ module.exports = {
44
testEnvironment: 'node',
55
workerThreads: true,
66
coverageReporters: ['lcov', 'text', 'html'],
7+
coveragePathIgnorePatterns: [
8+
'/node_modules/',
9+
'/test/utils/',
10+
'/test/mocks/',
11+
'/dist/',
12+
],
13+
moduleNameMapper: {
14+
'^fetchff$': '<rootDir>/src/index.ts',
15+
'^fetchff/(.*)$': '<rootDir>/src/$1.ts',
16+
},
717
};

0 commit comments

Comments
 (0)