How to use the xstream.fromPromise function in xstream

To help you get started, we’ve selected a few xstream 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 staltz / manyverse / src / frontend / screens / central / connections-tab / intent.ts View on Github external
.map(() =>
        xs.fromPromise(
          PermissionsAndroid.request(
            PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
            {
              title: 'Allow locating via Bluetooth?',
              message:
                'Manyverse needs to use Bluetooth to discover where you are ' +
                '("coarse location") and what peers are around you.',
              buttonPositive: 'Yes',
              buttonNegative: 'No',
            },
          ),
        ),
      )
github qiscus / qiscus-sdk-web-core / src / main.ts View on Github external
      .map(([token]) => xs.fromPromise(this.userAdapter.setUserFromIdentityToken(token)))
      .flatten()
github qiscus / qiscus-sdk-web-core / src / main.ts View on Github external
.map(([page, limit]) =>
        xs.fromPromise(this.userAdapter.getBlockedUser(page, limit))
      )
github staltz / manyverse / src / frontend / drivers / ssb.ts View on Github external
      .map(promise => xs.fromPromise(promise))
      .flatten();
github fanduel-oss / refract / examples / field-validation / xstream / src / index.js View on Github external
.map(username =>
            xs.fromPromise(
                fetch(`https://api.github.com/users/${username}`).then(res =>
                    res.json()
                )
            )
        )
github staltz / manyverse / src / frontend / drivers / dialogs.ts View on Github external
public showPicker(
    title?: string,
    content?: string,
    options?: OptionsPicker,
  ): Stream {
    return xs.fromPromise(DialogAndroid.showPicker(title, content, options));
  }
github qiscus / qiscus-sdk-web-core / src / main.ts View on Github external
.map(({ roomId, name, avatarUrl, extras }) =>
        xs.fromPromise(this.roomAdapter.updateRoom(roomId, name, avatarUrl, extras))
      )
github qiscus / qiscus-sdk-web-core / src / main.ts View on Github external
.map(([userId, userKey, username, avatarUrl, extras]) =>
        xs.fromPromise(
          this.userAdapter.login(userId, userKey, {
            name: username,
            avatarUrl,
            extras
          })
        )
      )
github qiscus / qiscus-sdk-web-core / src / main.ts View on Github external
.map(([username, avatarUrl, extras]) =>
        xs.fromPromise(this.userAdapter.updateUser(username, avatarUrl, extras))
      )
github qiscus / qiscus-sdk-web-core / src / main.ts View on Github external
.map(([uniqueId, name, avatarUrl, extras]) =>
        xs.fromPromise(this.roomAdapter.getChannel(uniqueId, name, avatarUrl, extras))
      )