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

Conversation

@ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Dec 16, 2020

This enables the fp/no-mutating-methods ESLint rule.

@ehmicky ehmicky added the type: chore work needed to keep the product and development running smoothly label Dec 16, 2020
@ehmicky ehmicky requested a review from erezrokah December 16, 2020 16:01
@ehmicky ehmicky self-assigned this Dec 16, 2020
// might live in two different locations

if (Array.isArray(shaMap[fileObj.hash])) {
// eslint-disable-next-line fp/no-mutating-methods
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code relies on streaming for performance reasons (hashing many files). Streaming relies on event handlers, which are hard to use in a purely functional way, which is why we need some mutation here.

There is a probably a way to do this in an incremental/performant way without mutation, but this could potentially break the logic.

@ehmicky ehmicky force-pushed the chore/no-mutating-methods branch from 5dcb4ac to 38030aa Compare December 16, 2020 18:36
@ehmicky ehmicky merged commit fc193a1 into master Dec 16, 2020
@ehmicky ehmicky deleted the chore/no-mutating-methods branch December 16, 2020 18:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

type: chore work needed to keep the product and development running smoothly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants