andrewdavey / andrewdavey/immutable-devtools

Typo in renderIterableBody?

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
671
Forks
32
PR merge metrics
No merged PRs in 30d

Description

Hi, I was reading through the code of this library, and read the `renderIterableBody` function. Here is the source for it:

```javascript
const renderIterableBody = (collection, mapper, options = {}) => {
if (options.sorted) {
collection = collection.sortBy((value, key) => key);
}
const children = collection
.map(mapper)
.toList();

const jsList = []
// Can't just call toJS because that will also call toJS on children inside the list
children.forEach(child => jsList.push(child))

return [ 'ol', listStyle, ...children ];
}
```

It seems that the author carefully crafted the `jsList` list, but then forgot to use it, and mistakenly used `children` instead.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.