mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-07 19:07:28 -08:00
d5c44987f4
* ⚡ Add infix to Pinia stores * ⚡ Fix paths in mocks * 🐛 Fix import
23 lines
562 B
TypeScript
23 lines
562 B
TypeScript
import type { Telemetry } from '@/plugins/telemetry';
|
|
import type { ITelemetryTrackProperties } from 'n8n-workflow';
|
|
import { defineStore } from 'pinia';
|
|
import type { Ref } from 'vue';
|
|
import { ref } from 'vue';
|
|
|
|
export const useTelemetryStore = defineStore('telemetry', () => {
|
|
const telemetry: Ref<Telemetry | undefined> = ref();
|
|
|
|
const init = (tel: Telemetry) => {
|
|
telemetry.value = tel;
|
|
};
|
|
|
|
const track = (event: string, properties?: ITelemetryTrackProperties) => {
|
|
telemetry.value?.track(event, properties);
|
|
};
|
|
|
|
return {
|
|
init,
|
|
track,
|
|
};
|
|
});
|