Skip to content
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

Support Immutables in records. #40

Merged
merged 1 commit into from
Dec 9, 2016
Merged

Conversation

lukesneeringer
Copy link
Contributor

This PR adds support for the use of immutables in records:

import {Record} from 'typed-immutable';

var MyRecord = Record({
  mapName: Immutable.Map,
});

The object form (e.g. new Immutable.Map()) also works, if you wish to provide a default.

This allows the original Immutable objects to be used within typed-immutable records when appropriate. The above would roughly be equivalent to Map(Any, Any), and Immutable.List would be equivalent to List(Any); however, we will no longer incur the overhead of using our own objects in these cases when we do not need the typing system.

Additionally, any additional objects Immutable provides, now or in the future, work. So, for instance, this supports Immutable.Set.

@lukesneeringer lukesneeringer merged commit ba575e1 into master Dec 9, 2016
@lukesneeringer lukesneeringer deleted the immutables-in-records branch December 9, 2016 06:56
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.

None yet

1 participant