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

Add support for static Immutable methods #158

Merged
merged 2 commits into from
Oct 17, 2016
Merged

Add support for static Immutable methods #158

merged 2 commits into from
Oct 17, 2016

Conversation

ghost1542
Copy link
Contributor

@ghost1542 ghost1542 commented Oct 16, 2016

First commit provides the fix for #130. Add static methods to Immutable while remaining backward compatible with current syntax.

// Those are equivalent

obj.setIn(['key'], value);
Immutable.setIn(obj, ['key'], value);

Second commit is only a proof that it works in test units. With some addition it may actually be fine, as it also makes tests cover static and non-static methods as a side effect. But I wasn't sure if @rtfeldman would prefer any different approach. This can be updated if this PR gets any interest.

Perhaps the documentation can also be updated to promote the static methods over the non-static ones, all up to you. I'm happy to add any further commits I'm asked for.

@rtfeldman
Copy link
Owner

Wow, this looks great @saivann! 😻 Thank you so much!

@theogravity
Copy link

This is amazing - thank you for the work. It's working great and things feel cleaner than it did before.

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.

4 participants