Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public isItAValidLoading(loading: boolean, variables: TVariables, networkStatus: NetworkStatus) {
if (
!this.myLoading &&
(!isEqual(variables, this.queryVariables) || networkStatus === NetworkStatus.refetch) &&
loading
) {
this.myLoading = true;
} else if (this.myLoading && !loading) {
this.myLoading = false;
}
this.setPrevVariables(variables);
return this.myLoading;
}
}
error: function (error) {
var previousResult = _this.previousResult;
if (!previousResult ||
previousResult.networkStatus === NetworkStatus.refetch) {
_this.resubscribeToQuery(client);
}
if (!error.hasOwnProperty('graphQLErrors'))
throw error;
_this.updateCurrentData();
},
});
error: function (error) {
var previousResult = _this.previousResult;
if (!previousResult ||
previousResult.networkStatus === NetworkStatus.refetch) {
_this.resubscribeToQuery(client);
}
if (!error.hasOwnProperty('graphQLErrors'))
throw error;
_this.updateCurrentData();
},
});