Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async sendEvent(event: Event): Promise {
const result = global.navigator.sendBeacon(this.url, JSON.stringify(event));
return this._buffer.add(
Promise.resolve({
status: result ? Status.Success : Status.Failed,
}),
);
}
}