-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
#2325 : Add $inc support for Helpers update #2352
Conversation
As far as I understand That being said, big thanks for contributing, I'd love to find something of significance that you could attack... :) |
I see ^^ Well, the feature was quite simple to implement, so it's no big deal. And I'd love to work on something more significant :) |
Hy! Thanks (: This would be really helpful to be included. As I've explained here: #2325 This would allow to reuse the same code for a mongodb database as in my case. If you want to reuse the logic between client and server side this would be an amazing addition. Waiting to be included. Currently I have the same logic, but somewhere is duplicated because I need update and the $inc doesn't work yet. For example this is the logic which runs both on client and on server:
This issue solves this problem:
Notice that I don't have duplicated logic, which is a pain to maintain ( In the future more people will use this technique to predict on the client and validate/update on the server using the exact same logic. Is very DRY and less prone to errors, inconsistencies. |
@totty90 If your goal is to be compatible with MongoDB, I would recommend that you fork/reimplement this helper for that specific goal. That's not to say it shouldn't be added to this React addon, but AFAIK MongoDB is just an inspiration for this helper, not the goal (as far as I'm aware, it's provided just to kickstart people who are new to React). |
@syranide Yes, I understand. But if we can both find some common use, I would appreciate. I would not like to keep a different fork of react.. And other people might even use it this way. |
@syranide I know about that. Maybe at least allow to monkey patch the lib externally, at runtime, without the need of a fork could be a solution? |
update is deprecated in favor of immutable.js We don't want to turn this into a DSL. |
You might be interested in https://github.com/kolodny/immutability-helper that lets you define custom operations by name. |
@ThomasCrvsr updated the pull request. |
No description provided.