You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clone is a bad, unmanageable and outdated piece of logic.
In case of cyclic objects it will break
We must remove it for good.
No real reason to use it any longer
I suggest exposing an internal cloneDeep:
export const cloneDeep = <T>(object: T): T =>
JSON.parse(JSON.stringify(object));
This is good since if cloning a FabricObject it will use the toObject method. And for all others is good enough.
The text was updated successfully, but these errors were encountered:
While not being a issue at all, something i have to point out that struck my eyes is that i removed 3 occurrences of the shitty word around this task and related PRs.
We have a code of conduct that was added after i joined but is still here since long time, and while we may agree or not with every paragraph of it, that's what we have and if i didn't use this occasion to remind ourselves to take additional care when expressing our opinions on code or ideas of other people, i would ignore the code of conduct myself too.
While shitty is exactly as bad as any strong statement that i do use as well, like doesn't make sense or typescript is dumb or i hate typescript, and does also fall in normal language we use everyday, to me shitty is more evident and i noticed it.
It just falls in the unprofessional category we cite in the code of conduct and we can just find some alternatives for it.
clone is a bad, unmanageable and outdated piece of logic.
In case of cyclic objects it will break
We must remove it for good.
No real reason to use it any longer
I suggest exposing an internal
cloneDeep
:This is good since if cloning a FabricObject it will use the
toObject
method. And for all others is good enough.The text was updated successfully, but these errors were encountered: