@@ -16,7 +16,7 @@ const ModelBatchRequest = {
1616 } ) ;
1717 } ,
1818 batchFetch ( ) {
19- const { apiRequests } = this ;
19+ const { apiRequests } = ModelBatchRequest ;
2020 for ( const field in apiRequests ) {
2121 const apiRequest = apiRequests [ field ] ;
2222 for ( const { query, requests } of Object . values ( apiRequest ) ) {
@@ -31,14 +31,14 @@ const ModelBatchRequest = {
3131 } ) ;
3232 }
3333 }
34- this . apiRequests = { } ;
34+ ModelBatchRequest . apiRequests = { } ;
3535 } ,
3636 setTimer ( ) {
37- if ( this . timer )
37+ if ( ModelBatchRequest . timer )
3838 return ;
39- this . timer = setTimeout ( ( ) => {
40- this . timer = null ;
41- this . batchFetch ( ) ;
39+ ModelBatchRequest . timer = setTimeout ( ( ) => {
40+ ModelBatchRequest . timer = null ;
41+ ModelBatchRequest . batchFetch ( ) ;
4242 } , 20 ) ;
4343 }
4444} ;
@@ -91,7 +91,7 @@ class ArSyncContainerBase {
9191 static _load ( { field, id, params, query } , root ) {
9292 const parsedQuery = parseRequest_1 . parseRequest ( query , true ) ;
9393 if ( id ) {
94- return ModelBatchRequest . fetch ( field , query , id ) . then ( data => new ArSyncRecord ( parsedQuery , data [ 0 ] , null , root ) ) ;
94+ return ModelBatchRequest . fetch ( field , query , id ) . then ( data => new ArSyncRecord ( parsedQuery , data , null , root ) ) ;
9595 }
9696 else {
9797 const request = { field, query, params } ;
0 commit comments