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
I'm trying to replace a value in an ArraySchema at a certain position. The obvious choice was the splice()method.
After looking at the code, it seems that the third argument is completely ignored by the splice implementation. Is this intended? The documentation clearly states "Changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.".
Also, the JS Array splice method allows for replacing elements. I would suggest adding support for replacing items or changing the method signature + documentation, because that behavior seems pretty confusing.
The text was updated successfully, but these errors were encountered:
Hi @larsschwegmann, this is still a missing feature on ArraySchema#splice(). Pull requests are welcome to include this feature on @colyseus/schema. Cheers!
I'm trying to replace a value in an ArraySchema at a certain position. The obvious choice was the
splice()
method.After looking at the code, it seems that the third argument is completely ignored by the splice implementation. Is this intended? The documentation clearly states "Changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.".
Also, the JS Array splice method allows for replacing elements. I would suggest adding support for replacing items or changing the method signature + documentation, because that behavior seems pretty confusing.
The text was updated successfully, but these errors were encountered: