-
Notifications
You must be signed in to change notification settings - Fork 2.2k
refactor(db): WIP new database API #1156
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
Conversation
src/database/list/loaded.ts
Outdated
import 'rxjs/add/operator/skipWhile'; | ||
import 'rxjs/add/operator/withLatestFrom'; | ||
import 'rxjs/add/operator/do'; | ||
import 'rxjs/add/operator/filter'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider refactoring these to call
style?
such as mentioned here https://github.com/angular/material2/blob/c564df61f48ff9c40eea237c394a15adac19cfdb/CODING_STANDARDS.md#rxjs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Totally on the //TODO: FIX THIS
list. Wanted to get the POC up and running first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah no probs, just being nit picky
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments are always welcome :)
src/database/observable/fromRef.ts
Outdated
.map((combined: SnapshotPrevKey) => { | ||
const {snapshot, prevKey} = combined; | ||
return { event, snapshot, prevKey } | ||
}).delay(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats up with this delay?
Looks like you're trying to ensure that it's at the end of the event loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! This is really for operations that happen with disconnected connections or when data exists in the cache. They can sometimes happen synchronously, which is an unfortunate quirk of the SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, sounds legit. Maybe a small comment noting that?
See #1158 for details. If you have comments about the API please direct your feedback to that issue to keep the discussion in one place. However, if you have questions or improvements for the code please place them here.