In a React Native project, I ran into a JSON.parse error on instantiating an AlpacaStream because (in this context) the default binary data type for WebSocket seems to be ArrayBuffer rather than Blob. This might be fixable by instead setting this.connection.binaryType = 'blob'; right after instantiating the WebSocket, but I offer this addition for any use cases where ArrayBuffer might be needed.
For reference, the decoding of the ArrayBuffer was taken from here.
Hi there,
In a React Native project, I ran into a JSON.parse error on instantiating an AlpacaStream because (in this context) the default binary data type for WebSocket seems to be ArrayBuffer rather than Blob. This might be fixable by instead setting
this.connection.binaryType = 'blob';
right after instantiating the WebSocket, but I offer this addition for any use cases where ArrayBuffer might be needed.For reference, the decoding of the ArrayBuffer was taken from here.