UNPKG

@metamask/snaps-simulation

Version:

A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment

25 lines 712 B
import { put } from "redux-saga/effects"; import { trackEvent } from "../../store/index.mjs"; /** * Track an event. * * @param event - The event to track. * @returns `null`. * @yields Adds the event to the store. */ function* trackEventImplementation(event) { yield put(trackEvent(event)); return null; } /** * Get a method that can be used to track an event. * * @param runSaga - A function to run a saga outside the usual Redux flow. * @returns A method that can be used to track an event. */ export function getTrackEventImplementation(runSaga) { return (...args) => { return runSaga(trackEventImplementation, ...args).result(); }; } //# sourceMappingURL=track-event.mjs.map