Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Prevent mutable structures when merging Immutable objects #220

Conversation

Methuselah96
Copy link

Resolves #70.

szepeviktor and others added 30 commits May 3, 2020 14:41
Follows up on moving from `facebook/immutable-js` to `immutable-js/immutable-js`. Removes all references to Facebook.
leebyron and others added 2 commits July 23, 2021 09:49
- When calling `Seq(value)` on an iterable value, use the convention of the default iterator method being equal to one of the prototype methods `value.entries()` and `value.keys()` as a clear indication of Keyed or Set style collections.
  - Introduces `isEntriesIterable()` and `isKeysIterable()` to capture these patterns.
  - Uses them within `Seq()` to produce an entries sequence or set sequence.
- Use the general `Seq()` in the implementation of `fromJS()`, rather than repeating the logic of determining which Seq conversion to apply.
  - Replaces this logic with constraints on which values can be converted
  - Introduces allowing iterable objects
  - Introduces allowing array-likes
- Add `toSet()` as a possible return from the default converter of `fromJS()` in the case the generated Seq is a SetSeq.
@Methuselah96 Methuselah96 deleted the fix-undefined-merge-cases branch September 16, 2021 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeepMerge transforms Map to [key, value] Array in some conflicts
8 participants