bitovi / bitovi/ylem

Ylem splices array-like objects passed as props

Open
#181 1 comment 0 reactions 1 assignee Claimed by @mikedane View on GitHub
bug
Dominant language
JavaScript
Stars
42
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Small bug in [observable-component.js](https://github.com/bitovi/ylem/blob/master/lib/observable-component.js) on line `95`

`canReflect.splice(canKey.get(observable, key), values.index, values.deleteCount, values.insert);`

This code seems to be modifying the original prop that was passed instead of replacing it with the new prop. This was initially intended to affect arrays only, and in the case where an array is being passed it should still behave this way. If however, an array-like object is passed this is not the desired behavior as that array-like object may have additional properties of interest to the child which need to be overwritten.

This should be re-written to simply pass the new prop when dealing with an array-like object, and to behave the same when dealing with a normal array.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.