-
Notifications
You must be signed in to change notification settings - Fork 26
Refactor public API: put default peer API under Fluence facade #72
Conversation
* @returns true if the object is FluencePeer false otherwise | ||
*/ | ||
static isInstance(obj: FluencePeer): boolean { | ||
if (obj && obj._isFluenceAwesome) { |
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.
(obj isInstanceOf FluencePeer) || (obj && obj._isFluenceAwesome)
?
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.
(obj && obj._isFluenceAwesome)
might return undefined. I wanted the return type to be strictly true\false
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'm about to check isInstanceOf
on the first try.
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.
Ok, I'll add the check
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.
The compiler isn't happy:
property '_isFluenceAwesome' does not exist on type 'never'.ts(2339)
No description provided.