Skip to content
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

feature: detect subscription support in provider #1015

Closed
simon-jentzsch opened this issue Sep 3, 2017 · 0 comments
Closed

feature: detect subscription support in provider #1015

simon-jentzsch opened this issue Sep 3, 2017 · 0 comments
Assignees
Labels
Discussion Enhancement Includes improvements or optimizations

Comments

@simon-jentzsch
Copy link
Contributor

simon-jentzsch commented Sep 3, 2017

currently in a lot of lines in the code the provider is checked whether is supports subscribe. This is done by simply checking, if the on-function exists

if (provider.on)
   ...
else
   ...

Since we also use different Wrappers, which even dynamically change the inner provider, this means, we must add and delete a function during runtime depending on the inner provider.
I would rather suggest a function supportsSubscription(). This would make it cleaner and easier to implement and even delegate this call to the inner wrapper.

if (provider.supportsSubscription())
   ...
else
   ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Enhancement Includes improvements or optimizations
Projects
None yet
Development

No branches or pull requests

3 participants