How to use the @graffy/common.simplifyQuery function in @graffy/common

To help you get started, we’ve selected a few @graffy/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github usegraffy / graffy / src / cache / Cache.js View on Github external
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);
  }