You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: possible to generate a function using useSWRInfinite on the swr client. (#1138)
* feat: add `swr/infinite` dependesies
* chore: refactor string construction process
* feat: add `useInfinite` property into `SwrOptions` type
* feat: define `swrKeyLoader` function generator
* chore: refactoring to store the function that defines `useSrw` in a variable
* feat: add useInfinite function string generator implementation
* chore: refactoring to separate enable and key implementation
* fix: enerated implementation mess
* fix: change presence/absence of definition with `override.swr.useinfinite`
* docs: add document for `orverride.swr.useInfinite`
Copy file name to clipboardexpand all lines: docs/src/pages/reference/configuration/output.md
+31
Original file line number
Diff line number
Diff line change
@@ -778,6 +778,37 @@ Default Value: `'root'`.
778
778
779
779
Can be used to set the value of `providedIn` on the generated Angular services. If `false`, no `providedIn` will be set. If `true` or not specified, it will fall back to the default value: `root`.
780
780
781
+
#### swr
782
+
783
+
Type: `Object`.
784
+
785
+
Give options to the generated `swr` client. It is also possible to extend the generated functions.
786
+
787
+
```js
788
+
module.exports= {
789
+
petstore: {
790
+
output: {
791
+
...
792
+
override: {
793
+
swr: {
794
+
useInfinite:true,
795
+
options: {
796
+
dedupingInterval:10000,
797
+
},
798
+
},
799
+
},
800
+
},
801
+
...
802
+
},
803
+
};
804
+
```
805
+
806
+
##### useInfinite
807
+
808
+
Type: `Boolean`.
809
+
810
+
Use to generate a <ahref="https://swr.vercel.app/docs/pagination#useswrinfinite"target="_blank">useSWRInfinite</a> custom hook.
0 commit comments