Skip to content

Update Immutable to v4 #2

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 5, 2019
Merged

Update Immutable to v4 #2

merged 2 commits into from
Mar 5, 2019

Conversation

nggonzalez
Copy link
Owner

@nggonzalez nggonzalez commented Mar 2, 2019

Description

Updates immutable to the latest version and adds an option for AnonymousRecords when the recordType is not found.

Changes

  • Update Iterable.isIterable to the new isCollection method for determining if something is an immutable Collection (Map, Set, List, OrderedSet, OrderedMap, Stack)
  • Update instanceof Record to Record.isRecord for checking if something is a Record
  • Remove record.toMap() and use record.toSeq() to iterate through key/value pairs
  • Add an option for throwOnMissingRecordType which defaults to true. When false, this option will enable the creation of AnonymousRecords that contain all of the data keys found in the initially decodedData.
  • Addressed @idolize comments to use a map instead of switch cases for encoding and decoding data

@nggonzalez nggonzalez merged commit 956cb2f into master Mar 5, 2019
@nggonzalez nggonzalez deleted the deps/immutable branch March 5, 2019 01:17
},
{} as any,
);
record = new (Record(
Copy link

Choose a reason for hiding this comment

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

Would be kinda cool if you cache this Record type somehow based on the keys so there is only one anon. Record type for a given "schema". Idk how much overhead it would be in code / what the perf tradeoffs would be between the two.

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.

2 participants