UNPKG

@metamask/snaps-simulation

Version:

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

21 lines 718 B
import $reduxjstoolkit from "@reduxjs/toolkit"; const { createAction, createSelector, createSlice } = $reduxjstoolkit; const INITIAL_STATE = { current: null, }; export const uiSlice = createSlice({ name: 'ui', initialState: INITIAL_STATE, reducers: { setInterface(state, action) { state.current = action.payload; }, closeInterface(state) { state.current = null; }, }, }); export const resolveInterface = createAction(`${uiSlice.name}/resolveInterface`); export const { setInterface, closeInterface } = uiSlice.actions; export const getCurrentInterface = createSelector((state) => state.ui, (ui) => ui.current); //# sourceMappingURL=ui.mjs.map