react-native-sdk icon indicating copy to clipboard operation
react-native-sdk copied to clipboard

Better events API

Open asutula opened this issue 5 years ago • 0 comments

Currently, we're just sending base64 strings of protobuf data for any events that include data. It's up the the SDK user to parse this data into the correct JS type (using the generated JS protobuf classes).

A better setup would be at least for the SDK to convert to the JS protobuf classes.

Even better would be to create explicit addListener function for each type, removing the general addListener method that takes an event type arg. So for example:

function addThreadAddedListener(listener: (thread: pb.Thread) => void)

asutula avatar Mar 07 '19 21:03 asutula