File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " swr-models" ,
3- "version" : " 1.0.14 " ,
3+ "version" : " 1.0.15 " ,
44 "description" : " SWR toolkit for abstracting API data models as React state objects." ,
55 "keywords" : [
66 " swr" ,
Original file line number Diff line number Diff line change @@ -105,13 +105,17 @@ export class SWRModelEndpoint<T extends object> {
105105
106106 public useInfinite < R extends object = T > ( config ?: SWRModelEndpointConfigOverride ) {
107107 const c = this . _configMerge ( config ) ;
108- return clientUseSWRInfinite < R > ( ( index , previousPageData ) => {
109- if ( previousPageData && ! c . pagination ?. hasMore ( previousPageData ) ) return null ;
110- const params = {
111- ...c . params ,
112- ...( c . pagination ? c . pagination . getParams ( index , previousPageData ) : { } ) ,
113- } ;
114- return this . endpoint ( { ...c , params } ) ;
115- } ) ;
108+ return clientUseSWRInfinite < R > (
109+ ( index , previousPageData ) => {
110+ if ( previousPageData && ! c . pagination ?. hasMore ( previousPageData ) ) return null ;
111+ const params = {
112+ ...c . params ,
113+ ...( c . pagination ? c . pagination . getParams ( index , previousPageData ) : { } ) ,
114+ } ;
115+ return this . endpoint ( { ...c , params } ) ;
116+ } ,
117+ getJson ,
118+ this . _configMerge ( config ) . swrConfig ,
119+ ) ;
116120 }
117121}
You can’t perform that action at this time.
0 commit comments