File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/firestore/src/api Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1169,9 +1169,9 @@ export class DocumentReference<T = firestore.DocumentData>
1169
1169
const userObserver = args [ currArg ] as PartialObserver <
1170
1170
firestore . DocumentSnapshot < T >
1171
1171
> ;
1172
- args [ currArg ] = userObserver . next ;
1173
- args [ currArg + 1 ] = userObserver . error ;
1174
- args [ currArg + 2 ] = userObserver . complete ;
1172
+ args [ currArg ] = userObserver . next ?. bind ( userObserver ) ;
1173
+ args [ currArg + 1 ] = userObserver . error ?. bind ( userObserver ) ;
1174
+ args [ currArg + 2 ] = userObserver . complete ?. bind ( userObserver ) ;
1175
1175
} else {
1176
1176
validateArgType (
1177
1177
'DocumentReference.onSnapshot' ,
@@ -2122,9 +2122,9 @@ export class Query<T = firestore.DocumentData> extends BaseQuery
2122
2122
const userObserver = args [ currArg ] as PartialObserver <
2123
2123
firestore . QuerySnapshot < T >
2124
2124
> ;
2125
- args [ currArg ] = userObserver . next ;
2126
- args [ currArg + 1 ] = userObserver . error ;
2127
- args [ currArg + 2 ] = userObserver . complete ;
2125
+ args [ currArg ] = userObserver . next ?. bind ( userObserver ) ;
2126
+ args [ currArg + 1 ] = userObserver . error ?. bind ( userObserver ) ;
2127
+ args [ currArg + 2 ] = userObserver . complete ?. bind ( userObserver ) ;
2128
2128
} else {
2129
2129
validateArgType ( 'Query.onSnapshot' , 'function' , currArg , args [ currArg ] ) ;
2130
2130
validateOptionalArgType (
You can’t perform that action at this time.
0 commit comments