File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,12 @@ export class ApolloProvider {
88 this . _collecting = false
99 }
1010
11- collect ( ) {
11+ collect ( options ) {
12+ const finalOptions = Object . assign ( { } , {
13+ waitForLoaded : true ,
14+ } , options )
1215 this . _promises = [ ]
16+ this . _collectingOptions = finalOptions
1317 this . _isCollecting = true
1418 return ( ) => this . _ensureReady ( )
1519 }
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ export class DollarApollo {
2121 this . provider . _waitFor ( new Promise ( ( resolve , reject ) => {
2222 sub = query . subscribe ( {
2323 next : result => {
24- resolve ( result )
24+ if ( ! this . provider . _collectingOptions . waitForLoaded || ! result . loading ) {
25+ resolve ( result )
26+ }
2527 } ,
2628 error : error => {
2729 reject ( error )
You can’t perform that action at this time.
0 commit comments