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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: put processes in class for state #781

Merged
merged 2 commits into from
Nov 4, 2021
Merged

fix: put processes in class for state #781

merged 2 commits into from
Nov 4, 2021

Conversation

bodinsamuel
Copy link
Contributor

No description provided.

@bodinsamuel bodinsamuel self-assigned this Nov 3, 2021
@Haroenv
Copy link
Collaborator

Haroenv commented Nov 4, 2021

Big change :D what's the pros/cons?

@bodinsamuel
Copy link
Contributor Author

bodinsamuel commented Nov 4, 2021

Having more and more "floating" state was bothering me + passing all params for each function starts to be too verbose.
Mostly a coding style reason, I'm fine with functional when it's very simple and portable function, here they are all tied together.

@bodinsamuel
Copy link
Contributor Author

Note: it's easier to review with Hide whitespace checked

Copy link
Collaborator

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code itself lgtm! would like to see if there's a way where the eslint rule doesn't need to be disabled

const { seq } = await this.stateManager.get();
const changesConsumer = this.changesConsumer;
if (!changesConsumer) {
log.warn('Can not watch without a consumer');
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we return undefined, is the eslint rule disabling still needed?

Suggested change
return;
return undefined;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue for that. we could disable the rule entirely for TS though
typescript-eslint/typescript-eslint#1277

@bodinsamuel bodinsamuel merged commit 275231c into master Nov 4, 2021
@bodinsamuel bodinsamuel deleted the fix/classify branch November 4, 2021 12:46
algolia-crawler-bot pushed a commit that referenced this pull request Nov 4, 2021
## [1.4.10](v1.4.9...v1.4.10) (2021-11-04)

### Bug Fixes

* put processes in class for state sake ([#781](#781)) ([275231c](275231c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants