@metamask/snaps-simulation
Version:
A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment
25 lines • 747 B
JavaScript
import { put } from "redux-saga/effects";
import { endTrace } from "../../store/index.mjs";
/**
* 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 put(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.
*/
export function getEndTraceImplementation(runSaga) {
return (...args) => {
return runSaga(endTraceImplementation, ...args).result();
};
}
//# sourceMappingURL=end-trace.mjs.map