UNPKG

@metamask/snaps-simulation

Version:

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

29 lines 959 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getEndTraceImplementation = void 0; const effects_1 = require("redux-saga/effects"); const store_1 = require("../../store/index.cjs"); /** * End a performance trace. * * @param event - The performance trace to end. * @returns `null`. * @yields Adds the completed trace to the store. */ function* endTraceImplementation(event) { yield (0, effects_1.put)((0, store_1.endTrace)(event)); return null; } /** * Get a method that can be used to end a performance trace. * * @param runSaga - A function to run a saga outside the usual Redux flow. * @returns A method that can be used to end a performance trace. */ function getEndTraceImplementation(runSaga) { return (...args) => { return runSaga(endTraceImplementation, ...args).result(); }; } exports.getEndTraceImplementation = getEndTraceImplementation; //# sourceMappingURL=end-trace.cjs.map