Closed angelcabo closed 3 years ago
Hi @angelcabo ! Thank you for the note! It's great to hear the integration has been working so far.
Ah, array comparison is a problem in general in JavaScript, is that right? http://stackoverflow.com/questions/7837456/comparing-two-arrays-in-javascript
I think this is exactly why libraries like underscore, etc. exist.
I definitely don't want to include underscore or make it a dependency for Ploma. However, if you'd like to submit a PR with an implementation like the one in the above SO link, I would be happy to check it out, test it, and incorporate it!
Let me know what you think. Ev
Hi there - I've been using ploma on a project I'm working on and so far so good!
In order to decide if I want to save updates made to a canvas back to my server I'd like to be able to check if the canvas has changes based on what I have already persisted. Unfortunately I can't just run a quick equality check on the array of strokes given the nature of the object. e.g. this will always eval as true.
So, in my app I've made a simple helper using underscore to accomplish this:
I was wondering if you think it makes sense to have this functionality as part of the core lib? Something like:
this.deltaStrokes = function (compareStrokes) { ... };
. Obviously if this was pulled in as core functionality you wouldn't want to add a dep on underscore, but I just wanted to get your thoughts on whether this made sense to include in ploma or not.