UNPKG

@unchainedshop/core-events

Version:

Event history and tracking module for the Unchained Engine

17 lines (16 loc) 505 B
import { getEmitHistoryAdapter, setEmitHistoryAdapter } from '@unchainedshop/events'; export const configureEventHistoryAdapter = (createFn) => { if (!getEmitHistoryAdapter()) { const adapter = { subscribe: () => { }, publish: async (eventName, { payload }) => { await createFn({ type: eventName, payload, }); }, }; setEmitHistoryAdapter(adapter); } };