How to use rx-binder - 2 common examples

To help you get started, we’ve selected a few rx-binder 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 nteract / nteract / packages / host-cache / src / host-storage.ts View on Github external
break;
      case PROVISIONING:
        // Wait for the provisioning server to get up
        while (original.type !== UP) {
          await sleep(1000);
          // NOTE: Could do coordination here by recording timestamps in the PROVISIONING type
          // At the very least there should come a point we time out at
          original = this.get(binderOpts);
        }

        if (original && original.type === UP) {
          return original.config;
        }
    }

    const host = await binder(binderOpts)
      .pipe(
        tap(x => {
          // Log binder messages to the console for debuggability
          console.log("%c BINDER MESSAGE", "color: rgb(87, 154, 202)");
          console.log(x);
        }),
        filter(msg => msg.phase === "ready"),
        map(msg => makeHost({ endpoint: msg.url, token: msg.token }))
      )
      .toPromise();

    if (
      !host.config ||
      !host.config.endpoint ||
      !host.config.token ||
      !host.config.crossDomain
github nteract / nteract / applications / play / redux / epics.js View on Github external
switchMap(({ payload: { serverId, oldServerId, repo, gitref } }) => {
      return binder({ repo, gitref }, EventSource).pipe(
        mergeMap(message => {
          const actionsArray = [
            actions.addServerMessage({ serverId, message })
          ];
          if (message.phase === "ready") {
            const config = {
              endpoint: message.url.replace(/\/\s*$/, ""),
              uri: "/",
              token: message.token,
              crossDomain: true
            };
            actionsArray.push(
              actions.activateServerFulfilled({ serverId, config })
            );
            actionsArray.push(actions.fetchKernelSpecs({ serverId }));
            if (oldServerId) {

rx-binder

RxJS bindings to Binder

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

63 / 100
Full package analysis

Popular rx-binder functions