Skip to content

Make onSnapshot work with rxjs observers #3318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 29, 2020
Merged

Make onSnapshot work with rxjs observers #3318

merged 3 commits into from
Jun 29, 2020

Conversation

Feiyang1
Copy link
Member

@Feiyang1 Feiyang1 commented Jun 29, 2020

It fixes an issue where passing rxjs Observer to onSnapshot causes error Error: Uncaught TypeError: this._next is not a function.
For example,

const data$ = rxjs.Observable.create(function subscribe(observer) {
  firebase.firestore().collection('test').onSnapshot(observer);
});

data$.subscribe({
  next: data => handleData(data)
});

A similar issue is being fixed for FCM - #3221

@changeset-bot
Copy link

changeset-bot bot commented Jun 29, 2020

🦋 Changeset is good to go

Latest commit: 1a7a3b5

We got this.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 29, 2020

Binary Size Report

Affected SDKs

  • @firebase/firestore

    Type Base (4d1712d) Head (d6d98d9) Diff
    browser 248 kB 248 kB +252 B (+0.1%)
    esm2017 193 kB 194 kB +260 B (+0.1%)
    main 493 kB 493 kB +350 B (+0.1%)
    module 246 kB 246 kB +252 B (+0.1%)
  • @firebase/firestore/memory

    Type Base (4d1712d) Head (d6d98d9) Diff
    browser 186 kB 186 kB +252 B (+0.1%)
    esm2017 145 kB 145 kB +260 B (+0.2%)
    main 362 kB 363 kB +350 B (+0.1%)
    module 184 kB 184 kB +252 B (+0.1%)
  • firebase

    Type Base (4d1712d) Head (d6d98d9) Diff
    firebase-firestore.js 286 kB 286 kB +252 B (+0.1%)
    firebase-firestore.memory.js 225 kB 226 kB +252 B (+0.1%)
    firebase.js 819 kB 820 kB +252 B (+0.0%)

Test Logs

"firebase": patch
---

Fixed an issue where `onSnapshot` doesn't work with rxjs [Observer](https://rxjs-dev.firebaseapp.com/guide/observer).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the change that broke this was merged on Friday and never released.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which one is it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Changed to an empty changeset.

@Feiyang1 Feiyang1 merged commit b8c0ceb into master Jun 29, 2020
@Feiyang1 Feiyang1 deleted the fei-rxjs-fix branch June 29, 2020 23:36
schmidt-sebastian pushed a commit that referenced this pull request Jun 30, 2020
* Make onSnapshot work with rxjs observers

* Create thin-ligers-fold.md

* Update thin-ligers-fold.md
@firebase firebase locked and limited conversation to collaborators Jul 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants