question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESLint rule to prevent `connectObservable` and `connectFactoryObservable` being used inside components

See original GitHub issue

I think that a common pitfall that new-comers will experience is that they may inadvertently use connectObservable/connectFactoryObservable from inside a functional component.

I think that we should create a ESLint rule so that developers don’t fall for that mistake. Any volunteers? cough @voliva cough

I think that as a first implementation something that just checks that the connector functions are being called from the “root scope” (not inside a function) should be enough? 🤔

Also, I think that the ESLint rule should be an error, not a warning.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
volivacommented, Jun 30, 2020

Sure, I’ll give it a go this afternoon!

1reaction
josepotcommented, Jul 1, 2020

I’m closing this issue, let’s continue the conversation in that PR/repo. Once again, thanks a lot @voliva !

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-rxjs/ban-observables.md at main - GitHub
This rule can be configured so that developers can ban any observable creators they want to avoid in their project. Options. This rule...
Read more >
Announcing NgRx Version 12: New operator for Effects ...
NgRx Effects allows you to isolate side effect logic from your components by listening to observable streams to perform some task.
Read more >
Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
When should I create a new Subscription for a specific side ...
RxJS is a valuable resource for managing asynchronous operations and should be used to simplify your code (including reducing the number of ...
Read more >
Gentle Introduction To ESLint Rules - DEV Community ‍ ‍
The team members often forgot to unsubscribe from RxJS observable, ... In the shell, type npx eslint use-let.js to see the result for ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found