Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async resubscribe() {
const query =
this.sumQuery && linkKnown(this.data, simplifyQuery(this.sumQuery));
// console.log(this.id, 'Resubscribe called', query);
if (isEqual(this.upstreamQuery, query)) return;
if (this.upstream) {
// console.log(this.id, 'Closing upstream sub', this.upstreamQuery);
this.upstream.return();
}
this.upstreamQuery = query;
if (!query) return;
// console.log(this.id, 'Opening upstream sub', query);
this.upstream = this.store.sub(query, { skipCache: true, raw: true });
this.putStream(this.upstream);
}