Thanks to @spencewood in #82 react-tracking now supports async
functions (or functions that return a Promise
)
@track()
async handleEvent() {
return await asyncCall(); // returns a promise
}
See the main README documentation for more details, including how to conditionally dispatch a tracking event only when the promise resolves and/or rejects.