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

Remove toPlainObject function #362

Merged
merged 3 commits into from
Sep 10, 2024
Merged

Remove toPlainObject function #362

merged 3 commits into from
Sep 10, 2024

Conversation

Pimm
Copy link
Collaborator

@Pimm Pimm commented Sep 10, 2024

This PR removes the toPlainObject function:

const plainPayment = payment.toPlainObject();

This function was originally implemented using Lodash' toPlainObject. I have personally never understood the use case of this function. I suspect this function has very few uses, if any. If my suspicion is wrong, I'll happily re-introduce it.

This function was originally implemented using Lodash' toPlainObject. I have personally never understood the use case of this function.
@janpaepke janpaepke merged commit a8d0ed2 into master Sep 10, 2024
5 checks passed
@janpaepke janpaepke deleted the pimm/no-to-plain-object branch September 10, 2024 13:43
@inglkruiz
Copy link

inglkruiz commented Oct 12, 2024

@Pimm Hi, actually in my case this function was extremely useful as I use it to store for instance Payment object in our DB. Later we use the Object for deriving our own app DB model because we integrate multiple payment providers, Mollie in Europe and Stripe in the US, at the moment.

@janpaepke
Copy link
Collaborator

Thank you for your feedback, @inglkruiz.

Could you share a little bit more about your implementation details?
Specifically why a simple destructuring would not help in your usecase?
i.e. storeInDb({...payment}) ?

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