alpacahq / alpaca-ts

A TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams.
ISC License
154 stars 42 forks source link

Types for streams #26

Closed KalebMills closed 3 years ago

KalebMills commented 3 years ago

Looks like here a generic emitter is used when something is received over the socket connection. This bit of code looks handy, but it's not useful as it pertains to types. Seems since this is supposed to be a Typescript superset of the alpacas library, these should be individually typed.

My suggestion is to add overloads the allow types to be had for these emitted values.

117 commented 3 years ago

Will write them later today. They should be typed in the first place 🤦‍♂️. Good issue! 🙂

KalebMills commented 3 years ago

PR