How to use the wonka.fromValue 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
executeQuery = <data>(
    query: GraphQLRequest,
    opts?: Partial
  ): Source&gt; =&gt; {
    const operation = this.createRequestOperation('query', query, opts);
    const response$ = this.executeRequestOperation(operation);
    const { pollInterval } = operation.context;

    if (pollInterval) {
      return pipe(
        merge([fromValue(0), interval(pollInterval)]),
        switchMap(() =&gt; response$)
      );
    }

    return response$;
  };
</data>