@@ -121,11 +121,14 @@ let DefaultLiveQueryController = {
121
121
sessionToken,
122
122
} ) ;
123
123
// Register a default onError callback to make sure we do not crash on error
124
+ // Cannot create these events on a nested way because of EventEmiiter from React Native
124
125
defaultLiveQueryClient . on ( 'error' , ( error ) => {
125
126
LiveQuery . emit ( 'error' , error ) ;
126
- } ) . on ( 'open' , ( ) => {
127
+ } ) ;
128
+ defaultLiveQueryClient . on ( 'open' , ( ) => {
127
129
LiveQuery . emit ( 'open' ) ;
128
- } ) . on ( 'close' , ( ) => {
130
+ } ) ;
131
+ defaultLiveQueryClient . on ( 'close' , ( ) => {
129
132
LiveQuery . emit ( 'close' ) ;
130
133
} ) ;
131
134
@@ -160,18 +163,23 @@ let DefaultLiveQueryController = {
160
163
subscriptionWrap . query = subscription . query ;
161
164
subscriptionWrap . sessionToken = subscription . sessionToken ;
162
165
subscriptionWrap . unsubscribe = subscription . unsubscribe ;
163
-
166
+ // Cannot create these events on a nested way because of EventEmiiter from React Native
164
167
subscription . on ( 'open' , ( ) => {
165
168
subscriptionWrap . emit ( 'open' ) ;
166
- } ) . on ( 'create' , ( object ) => {
169
+ } ) ;
170
+ subscription . on ( 'create' , ( object ) => {
167
171
subscriptionWrap . emit ( 'create' , object ) ;
168
- } ) . on ( 'update' , ( object ) => {
172
+ } ) ;
173
+ subscription . on ( 'update' , ( object ) => {
169
174
subscriptionWrap . emit ( 'update' , object ) ;
170
- } ) . on ( 'enter' , ( object ) => {
175
+ } ) ;
176
+ subscription . on ( 'enter' , ( object ) => {
171
177
subscriptionWrap . emit ( 'enter' , object ) ;
172
- } ) . on ( 'leave' , ( object ) => {
178
+ } ) ;
179
+ subscription . on ( 'leave' , ( object ) => {
173
180
subscriptionWrap . emit ( 'leave' , object ) ;
174
- } ) . on ( 'delete' , ( object ) => {
181
+ } ) ;
182
+ subscription . on ( 'delete' , ( object ) => {
175
183
subscriptionWrap . emit ( 'delete' , object ) ;
176
184
} ) ;
177
185
0 commit comments