Granjow/artnet-base

Send typed Arrays

Opened this issue · 3 comments

].concat( this.data );

Change concat call to....

].concat( ...this.data );

... will fix the issue.

Thanks for your work - works great for me.

Thanks @unic8s ! Can you explain a bit more in detail what issue this fixes? Both statements produce the same result for me.

Sorry for delay @Granjow . I prepared a demo https://codepen.io/unic8/pen/RwgWaxG
Your library currently attaches the array in a nested way. The proposed solution attaches it flat.

It's only about arrays. I send ArtNet data arrays with about 1.000.000 values per second I cannot execute this to often and I attach flat arrays to the body of an ArtNet package.

Sorry too for the late reply @unic8s.

According to MDN, concat accepts arrays or values and array1.concat(array2) should return a new flat array. This is also what I observe when running it on my machine™. Where/how do you get this array nested?

The demo link you posted looks empty here.