faunadb-js icon indicating copy to clipboard operation
faunadb-js copied to clipboard

Incorrect types for callback to Stream events

Open jaredpereira opened this issue 3 years ago • 1 comments

Hi! I'm trying out the new Streaming feature, and it seems like there are some inconsistencies between the types and the actual behavior.

The callback to stream events seems to be called with just the event object as the first argument, and the event object along with the transaction id and event type as the second argument.

https://github.com/fauna/faunadb-js/blob/3f07a6fb4c9fa01f227c5ac242e8da21936f4567/src/stream.js#L210

However, the types indicate that the first argument is the event type, followed by the transaction id, and finally the event object.

https://github.com/fauna/faunadb-js/blob/3f07a6fb4c9fa01f227c5ac242e8da21936f4567/src/types/Stream.d.ts#L24-L33

jaredpereira avatar Mar 15 '21 20:03 jaredpereira

Thank you for creating the issue. Types improving is on our road map. Meanwhile, I created a ticket for this bug and our project manager will prioritize it. we track it internally as DRV-561

fireridlle avatar Mar 16 '21 07:03 fireridlle