@@ -180,11 +180,7 @@ export class QueriesObserver<
180180
181181 getOptimisticResult (
182182 queries : Array < QueryObserverOptions > ,
183- combine : CombineFn < TCombinedResult > | undefined ,
184- structuralSharing :
185- | boolean
186- | ( ( oldData : unknown | undefined , newData : unknown ) => unknown )
187- | undefined ,
183+ options ?: QueriesObserverOptions < TCombinedResult > ,
188184 ) : [
189185 rawResult : Array < QueryObserverResult > ,
190186 combineResult : ( r ?: Array < QueryObserverResult > ) => TCombinedResult ,
@@ -203,8 +199,7 @@ export class QueriesObserver<
203199 ( r ?: Array < QueryObserverResult > ) => {
204200 return this . #combineResult(
205201 r ?? result ,
206- combine ,
207- structuralSharing ,
202+ options ,
208203 queryHashes ,
209204 )
210205 } ,
@@ -233,13 +228,11 @@ export class QueriesObserver<
233228
234229 #combineResult(
235230 input : Array < QueryObserverResult > ,
236- combine : CombineFn < TCombinedResult > | undefined ,
237- structuralSharing :
238- | boolean
239- | ( ( oldData : unknown | undefined , newData : unknown ) => unknown )
240- | undefined = true ,
231+ options ?: QueriesObserverOptions < TCombinedResult > ,
241232 queryHashes ?: Array < string > ,
242233 ) : TCombinedResult {
234+ const combine = options ?. combine
235+ const structuralSharing = options ?. structuralSharing ?? true
243236 if ( combine ) {
244237 const lastHashes = this . #lastQueryHashes
245238 const queryHashesChanged =
@@ -325,8 +318,7 @@ export class QueriesObserver<
325318 const newTracked = this . #trackResult( this . #result, this . #observerMatches)
326319 const newResult = this . #combineResult(
327320 newTracked ,
328- this . #options?. combine ,
329- this . #options?. structuralSharing ,
321+ this . #options,
330322 )
331323
332324 if ( previousResult !== newResult ) {
0 commit comments