-
Notifications
You must be signed in to change notification settings - Fork 945
Make MaybeDocument an abstract class #1153
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
b403624
to
bc60dd7
Compare
* Represents a document in Firestore with a key, version, data and whether the | ||
* data has local mutations applied to it. | ||
*/ | ||
export class Document implements MaybeDocument { |
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.
Shouldn't this be extends
rather than implements
?
Here and below.
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, I would have hoped that TS complains about things like this.
@@ -68,7 +81,7 @@ export class Document { | |||
); | |||
} | |||
|
|||
static compareByKey(d1: MaybeDocument, d2: MaybeDocument): number { | |||
static compareByKey(d1: Document, d2: Document): number { |
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.
Why shouldn't this accept MaybeDocument
?
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.
I moved this method up to the base class and changed it to accept MaybeDocument. I just thought it was odd that it accepts MaybeDocument, but is part of a subclass.
CI failed to build on this error: TS2345 Argument of type 'MaybeDocument' is not assignable to parameter of type 'Document'.\n Property 'hasLocalMutations' is missing in type 'MaybeDocument' |
Feedback addressed. Build passing :) |
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.
LGTM
... with the class comments from Android.