INNER CODE UNIT · TypeScript

observerCallback

microsoft/graphitation · packages/apollo-forest-run/compat/src/core/__tests__/QueryManager/index.ts:533

    const observerCallback = wrap(reject, () => {
      reject(new Error('Link subscription should have been cancelled'));
    });

    const subscription = observableQuery.subscribe({
      next: observerCallback,
      error: observerCallback,
      complete: observerCallback
    });

    subscription.unsubscribe();

    return new Promise(
      // Unsubscribing from the link happens after a microtask
      // (Promise.resolve().then) delay, so we need to wait at least that
      // long before verifying onRequestUnsubscribe was called.
      resolve => setTimeout(resolve, 0)
    ).then(() => {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…