-
Notifications
You must be signed in to change notification settings - Fork 39
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
applyPatch issue with dates #78
Comments
First, a partial easy answer: your The differing behavior of Btw the reason why Sorry to say, but I think part of the solution is to make your More to your point though it might be reasonable to specially treat |
@chbrown thank you for the update. Yes, looks like P.S. Maybe it's worth adding a |
Fixed on FYI, I changed my mind about the solution — once I got into writing the fix I realized that adding a special case for classifying Dates as "primitive" would introduce practically as much complexity as a special case for properly cloning them, so I implemented the latter.
Your premise isn't quite right, because I don't "do everything by myself," but let me try to address what I think you're getting at:
Good point. I should do that -> #79. |
@chbrown don't get me wrong, I see your point of view and can (should) accept it! just wanted to hear that point and avoid any assumptions 😉 P.S. will check the fix tomorrow and come with updates |
@chbrown the fix covers all my cases, so looks like it's ready for a new npm version 😉 |
Due to clone's specific behavior: source - should be a JavaScript primitive, Array, or (plain old) Object., it's hard to work with Dates.
Is this behavior important and couldn't be changed for some reason? Is it possible to work-around this?
UPDATE 1
For the sake of curiosity used
lodash.cloneDeep
and my issue was fixed (without breaking any tests)The text was updated successfully, but these errors were encountered: