@metamask/snaps-simulation
Version:
A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment
24 lines • 949 B
JavaScript
;
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentInterface = exports.closeInterface = exports.setInterface = exports.resolveInterface = exports.uiSlice = void 0;
const toolkit_1 = require("@reduxjs/toolkit");
const INITIAL_STATE = {
current: null,
};
exports.uiSlice = (0, toolkit_1.createSlice)({
name: 'ui',
initialState: INITIAL_STATE,
reducers: {
setInterface(state, action) {
state.current = action.payload;
},
closeInterface(state) {
state.current = null;
},
},
});
exports.resolveInterface = (0, toolkit_1.createAction)(`${exports.uiSlice.name}/resolveInterface`);
_a = exports.uiSlice.actions, exports.setInterface = _a.setInterface, exports.closeInterface = _a.closeInterface;
exports.getCurrentInterface = (0, toolkit_1.createSelector)((state) => state.ui, (ui) => ui.current);
//# sourceMappingURL=ui.cjs.map