navigation_plus-1.0.5/js/edit_mode/store/slices/hot-key-slice.js

js/edit_mode/store/slices/hot-key-slice.js
import { createSlice } from '@reduxjs/toolkit';
import store from '../store';

const hotKeySlice = createSlice({
  name: 'hotkey',
  initialState: {
    enabled: true,
  },
  reducers: {
    setHotKey: (state, action) => {
      state.enabled = action.payload;
    },
  },
});

export const { setHotKey } = hotKeySlice.actions;
export default hotKeySlice.reducer;

window.setHotKey = (enabled) => {
  store.dispatch(setHotKey({ enabled }));
};

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc