-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Motivation
I noticed that the analyticsTracker
option of initPerfume
is expected to be a void callback. It would be useful if it could accept a promise, WDYT?
Example
In my use case, I'm collecting data in IndexedDB using idb-keyval
, which is a fully promisified library. It would be helpful if I could use await
within the callback.
import {set} from "idb-keyval";
import {initPerfume} from "perfume.js";
const startMonitoring = () => {
const analyticsTracker = async ({
metricName,
data
}: IAnalyticsTrackerOptions): Promise<void> => {
await set(crypto.randomUUID(), {metricName, data});
};
initPerfume({analyticsTracker});
};
Metadata
Metadata
Assignees
Labels
No labels