How to use the wonka.onEnd function in wonka

To help you get started, we’ve selected a few wonka 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 FormidableLabs / urql / src / client.ts View on Github external
operationResults$,
        onStart(() => this.dispatchOperation(operation)),
        take(1)
      );
    }

    const teardown$ = pipe(
      this.operations$,
      filter(op => op.operationName === 'teardown' && op.key === key)
    );

    const result$ = pipe(
      operationResults$,
      takeUntil(teardown$),
      onStart(() => this.onOperationStart(operation)),
      onEnd(() => this.onOperationEnd(operation))
    );

    return operation.context.suspense !== false &&
      this.suspense &&
      operationName === 'query'
      ? toSuspenseSource(result$)
      : result$;
  }