mirror of
https://github.com/chinchang/web-maker.git
synced 2025-10-15 13:24:25 +02:00
add ui events
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { trackEvent } from './analytics';
|
||||
|
||||
export const commandPaletteService = {
|
||||
subscriptions: {},
|
||||
subscribe(eventName, callback) {
|
||||
@@ -11,6 +13,7 @@ export const commandPaletteService = {
|
||||
};
|
||||
},
|
||||
publish(eventName, ...args) {
|
||||
trackEvent('ui', 'commandPaletteCommandSelected', eventName);
|
||||
const callbacks = this.subscriptions[eventName] || [];
|
||||
callbacks.forEach(callback => {
|
||||
callback(...args);
|
||||
|
Reference in New Issue
Block a user