How to use the @bbp/nexus-link.poll function in @bbp/nexus-link

To help you get started, we’ve selected a few @bbp/nexus-link 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 BlueBrain / nexus-js / packages / nexus-sdk / src / nexusSdk.ts View on Github external
const defaultContext = { uri: options.uri };
  const context: NexusContext = options.context
    ? { ...options.context, ...defaultContext }
    : defaultContext;

  const fetchers: Fetchers = {
    httpGet: operation => toPromise(requestHandler(operation)),
    httpPost: operation =>
      toPromise(pipe([setMethod('POST'), requestHandler])(operation)),
    httpPut: operation =>
      toPromise(pipe([setMethod('PUT'), requestHandler])(operation)),
    httpPatch: operation =>
      toPromise(pipe([setMethod('PATCH'), requestHandler])(operation)),
    httpDelete: operation =>
      toPromise(pipe([setMethod('DELETE'), requestHandler])(operation)),
    poll: pipe([poll(1000), requestHandler]),
  };

  return {
    context,
    Organization: Organization(fetchers, context),
    Project: Project(fetchers, context),
    Resource: Resource(fetchers, context),
    View: View(fetchers, context),
    Resolver: Resolver(fetchers, context),
    Schema: Schema(fetchers, context),
    File: NexusFile(fetchers, context),
    Storage: Storage(fetchers, context),
    Identity: Identity(fetchers, context),
    Realm: Realm(fetchers, context),
    Permissions: Permissions(fetchers, context),
    ACL: ACL(fetchers, context),

@bbp/nexus-link

A powerful, extendable way of controlling requests/responses to/from Nexus. Inspired by Apollo-link.

Apache-2.0
Latest version published 2 years ago

Package Health Score

49 / 100
Full package analysis