Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Refactor public API: put default peer API under Fluence facade #72

Merged
merged 8 commits into from
Sep 10, 2021

Conversation

coder11
Copy link
Contributor

@coder11 coder11 commented Sep 10, 2021

No description provided.

@coder11 coder11 requested review from alari and folex September 10, 2021 13:11
* @returns true if the object is FluencePeer false otherwise
*/
static isInstance(obj: FluencePeer): boolean {
if (obj && obj._isFluenceAwesome) {
Copy link
Member

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)?

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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)

@coder11 coder11 merged commit 608506d into master Sep 10, 2021
@coder11 coder11 deleted the refactor-public-api branch September 10, 2021 16:21
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