@@ -284,7 +284,8 @@ var LivePG = (function (_EventEmitter) {
284
284
triggers : triggers ,
285
285
data : [ ] ,
286
286
handlers : [ handle ] ,
287
- notifications : [ ]
287
+ notifications : [ ] ,
288
+ initialized : false
288
289
} ;
289
290
context$2$0 . next = 11 ;
290
291
return common . getClient ( this . connStr ) ;
@@ -411,7 +412,7 @@ var LivePG = (function (_EventEmitter) {
411
412
} , {
412
413
key : '_updateQuery' ,
413
414
value : function _updateQuery ( queryHash ) {
414
- var pgHandle , queryBuffer , update , _iteratorNormalCompletion4 , _didIteratorError4 , _iteratorError4 , _iterator4 , _step4 , updateHandler ;
415
+ var pgHandle , queryBuffer , update , _iteratorNormalCompletion4 , _didIteratorError4 , _iteratorError4 , _iterator4 , _step4 , updateHandler , _iteratorNormalCompletion5 , _didIteratorError5 , _iteratorError5 , _iterator5 , _step5 ;
415
416
416
417
return _regeneratorRuntime . async ( function _updateQuery$ ( context$2$0 ) {
417
418
while ( 1 ) switch ( context$2$0 . prev = context$2$0 . next ) {
@@ -431,7 +432,7 @@ var LivePG = (function (_EventEmitter) {
431
432
pgHandle . done ( ) ;
432
433
433
434
if ( ! ( update !== null ) ) {
434
- context$2$0 . next = 29 ;
435
+ context$2$0 . next = 31 ;
435
436
break ;
436
437
}
437
438
@@ -480,10 +481,68 @@ var LivePG = (function (_EventEmitter) {
480
481
return context$2$0 . finish ( 21 ) ;
481
482
482
483
case 29 :
484
+ context$2$0 . next = 51 ;
485
+ break ;
486
+
487
+ case 31 :
488
+ if ( ! ( queryBuffer . initialized === false ) ) {
489
+ context$2$0 . next = 51 ;
490
+ break ;
491
+ }
492
+
493
+ _iteratorNormalCompletion5 = true ;
494
+ _didIteratorError5 = false ;
495
+ _iteratorError5 = undefined ;
496
+ context$2$0 . prev = 35 ;
497
+
498
+ // Initial update with empty data
499
+ for ( _iterator5 = _getIterator ( queryBuffer . handlers ) ; ! ( _iteratorNormalCompletion5 = ( _step5 = _iterator5 . next ( ) ) . done ) ; _iteratorNormalCompletion5 = true ) {
500
+ updateHandler = _step5 . value ;
501
+
502
+ updateHandler . emit ( 'update' , { removed : null , moved : null , copied : null , added : [ ] } , [ ] ) ;
503
+ }
504
+ context$2$0 . next = 43 ;
505
+ break ;
506
+
507
+ case 39 :
508
+ context$2$0 . prev = 39 ;
509
+ context$2$0 . t4 = context$2$0 [ 'catch' ] ( 35 ) ;
510
+ _didIteratorError5 = true ;
511
+ _iteratorError5 = context$2$0 . t4 ;
512
+
513
+ case 43 :
514
+ context$2$0 . prev = 43 ;
515
+ context$2$0 . prev = 44 ;
516
+
517
+ if ( ! _iteratorNormalCompletion5 && _iterator5 [ 'return' ] ) {
518
+ _iterator5 [ 'return' ] ( ) ;
519
+ }
520
+
521
+ case 46 :
522
+ context$2$0 . prev = 46 ;
523
+
524
+ if ( ! _didIteratorError5 ) {
525
+ context$2$0 . next = 49 ;
526
+ break ;
527
+ }
528
+
529
+ throw _iteratorError5 ;
530
+
531
+ case 49 :
532
+ return context$2$0 . finish ( 46 ) ;
533
+
534
+ case 50 :
535
+ return context$2$0 . finish ( 43 ) ;
536
+
537
+ case 51 :
538
+
539
+ queryBuffer . initialized = true ;
540
+
541
+ case 52 :
483
542
case 'end' :
484
543
return context$2$0 . stop ( ) ;
485
544
}
486
- } , null , this , [ [ 13 , 17 , 21 , 29 ] , [ 22 , , 24 , 28 ] ] ) ;
545
+ } , null , this , [ [ 13 , 17 , 21 , 29 ] , [ 22 , , 24 , 28 ] , [ 35 , 39 , 43 , 51 ] , [ 44 , , 46 , 50 ] ] ) ;
487
546
}
488
547
} , {
489
548
key : '_processNotification' ,
0 commit comments