@@ -117,6 +117,7 @@ var config: { [key: string]: mixed } = {
117
117
! process . version . electron ) ,
118
118
REQUEST_ATTEMPT_LIMIT : 5 ,
119
119
SERVER_URL : 'https://api.parse.com/1' ,
120
+ LIVEQUERY_SERVER_URL : null ,
120
121
VERSION : 'js' + require ( '../package.json' ) . version ,
121
122
APPLICATION_ID : null ,
122
123
JAVASCRIPT_KEY : null ,
@@ -455,5 +456,25 @@ module.exports = {
455
456
456
457
getUserController ( ) : UserController {
457
458
return config [ 'UserController' ] ;
459
+ } ,
460
+
461
+ setLiveQueryController ( controller : any ) {
462
+ if ( typeof controller . subscribe !== 'function' ) {
463
+ throw new Error ( 'LiveQueryController must implement subscribe()' ) ;
464
+ }
465
+ if ( typeof controller . unsubscribe !== 'function' ) {
466
+ throw new Error ( 'LiveQueryController must implement unsubscribe()' ) ;
467
+ }
468
+ if ( typeof controller . open !== 'function' ) {
469
+ throw new Error ( 'LiveQueryController must implement open()' ) ;
470
+ }
471
+ if ( typeof controller . close !== 'function' ) {
472
+ throw new Error ( 'LiveQueryController must implement close()' ) ;
473
+ }
474
+ config [ 'LiveQueryController' ] = controller ;
475
+ } ,
476
+
477
+ getLiveQueryController ( ) : any {
478
+ return config [ 'LiveQueryController' ] ;
458
479
}
459
480
}
0 commit comments