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

Added copyPasteProps helper #75

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gavinmcfarland
Copy link

Hi,

I created this function based on the clone function which only copies compatible properties between nodes. It's explicit in properties which are allowed, so it is safer. It also has an option to exclude and include specific properties.

Feel free to make suggestions to modify the actual function, maybe there is a DRYer way to write the function itself.

@alexandrtovmach alexandrtovmach self-requested a review December 20, 2020 10:49
@alexandrtovmach alexandrtovmach self-assigned this Dec 20, 2020
@gavinmcfarland
Copy link
Author

I've been using this helper in my own project. I believe there are still.some edge cases that may need to be covered. For example what happens when properties with mixed values are copied and pasted.

Also we should consider that the default behaviour is. I have thoughts about whether is should (or should not) copy properties like the name by default. Should it match the same as the copy and paste ability in the editor? These are some things for us to consider.

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.

2 participants