Skip to content

(firestore) Update to rxjs pipeable operators#1623

Merged
jamesdaniels merged 3 commits intoangular:masterfrom
jymdman:firestore-rxjs-pipeable
May 11, 2018
Merged

(firestore) Update to rxjs pipeable operators#1623
jamesdaniels merged 3 commits intoangular:masterfrom
jymdman:firestore-rxjs-pipeable

Conversation

@jymdman
Copy link
Copy Markdown
Contributor

@jymdman jymdman commented May 11, 2018

Checklist

  • Issue number for this PR: #nnn (required)
  • Docs included?: (yes/no; required for all API/functional changes)
  • Test units included?: (yes/no; required)
  • In a clean directory, yarn install, yarn test run successfully? (yes/no; required)

Description

Updates firstore to rxjs pipeable operators

.pipe(
map(action =>
action.payload.docChanges
.map(change => ({ type: change.type, payload: change }))));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shouldn't this be a pipe + map?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

action.payload.docChanges isn't Observable, so I think no?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see, derp.

Comment thread src/firestore/firestore.ts Outdated
this.persistenceEnabled$ = zone.runOutsideAngular(() =>
shouldEnablePersistence ? from(this.firestore.enablePersistence().then(() => true, () => false))
: of(false)
shouldEnablePersistence ? Observable.from(this.firestore.enablePersistence().then(() => true, () => false))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should import of and from rather than using Observable.from and Observable.of

@jamesdaniels jamesdaniels merged commit 97b26e3 into angular:master May 11, 2018
@jymdman jymdman deleted the firestore-rxjs-pipeable branch May 11, 2018 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants