@@ -44,37 +44,37 @@ export class RenderPromises {
44
44
// Registers the server side rendered observable.
45
45
public registerSSRObservable < TData , TVariables > (
46
46
observable : ObservableQuery < any , TVariables > ,
47
- props : QueryDataOptions < TData , TVariables >
47
+ options : QueryDataOptions < TData , TVariables >
48
48
) {
49
49
if ( this . stopped ) return ;
50
- this . lookupQueryInfo ( props ) . observable = observable ;
50
+ this . lookupQueryInfo ( options ) . observable = observable ;
51
51
}
52
52
53
53
// Get's the cached observable that matches the SSR Query instances query and variables.
54
54
public getSSRObservable < TData , TVariables > (
55
- props : QueryDataOptions < TData , TVariables >
55
+ options : QueryDataOptions < TData , TVariables >
56
56
) : ObservableQuery < any , TVariables > | null {
57
- return this . lookupQueryInfo ( props ) . observable ;
57
+ return this . lookupQueryInfo ( options ) . observable ;
58
58
}
59
59
60
60
public addQueryPromise (
61
61
queryInstance : QueryData ,
62
+ // TODO: This callback is a noop on the useQuery side.
62
63
finish : ( ) => React . ReactNode
63
64
) : React . ReactNode {
64
65
if ( ! this . stopped ) {
65
66
const info = this . lookupQueryInfo ( queryInstance . getOptions ( ) ) ;
66
67
if ( ! info . seen ) {
67
68
this . queryPromises . set (
68
69
queryInstance . getOptions ( ) ,
69
- new Promise ( resolve => {
70
- resolve ( queryInstance . fetchData ( ) ) ;
71
- } )
70
+ new Promise ( resolve => resolve ( queryInstance . fetchData ( ) ) )
72
71
) ;
73
72
// Render null to abandon this subtree for this rendering, so that we
74
73
// can wait for the data to arrive.
75
74
return null ;
76
75
}
77
76
}
77
+
78
78
return finish ( ) ;
79
79
}
80
80
0 commit comments