react-tracking
react-tracking copied to clipboard
Expose return value of dispatch call via trackEvent
This allows us to receive the result of the dispatch function in trackEvent calls.
Main use case for this is waiting to execute code until the event has been successfully tracked. Our tracking method inside of dispatch() returns a promise that resolves when the event has been successfully tracked.
We can use this to delay execution of events (for example exiting link clicks on critical events) until the event has tracked.
Nice. The use case makes sense 👍
Mind adding some docs and a test case please?
Yes, some documentation would be great