lswartsenburg / klaviyo-node

A third party maintained Node.js package for sending Klaviyo events
Apache License 2.0
1 stars 5 forks source link

Track and identify functions don't return promises #9

Closed julianvogels closed 5 years ago

julianvogels commented 5 years ago

I would like to handle any errors when calling track or identify functions. However, the functions don't return anything. The function _requestKlaviyo creates and returns a Promise to the track and identify functions, but this Promise is not returned by the latter two: https://github.com/itso-io/klaviyo-node/blob/a79a670ef8585ca493ecc6b9f2686bf6c01e5cf8/lib/index.js#L184

Is this intentional? Are there reasons for not passing along the Promise for error handling and logic further down in my application?

lucas-belvin commented 5 years ago

@julianvogels Great point! There's no good reason and @emmanuelbuah already created a PR. Will merge now.