UNPKG

@maap-jupyterlab/dps-jupyter-extension

Version:

A JupyterLab extension for submitting and viewing jobs.

24 lines (23 loc) 673 B
import { createSlice } from '@reduxjs/toolkit'; const initialState = { switchIsChecked: false, switchIsDisabled: true }; export const CMRSwitchSlice = createSlice({ name: 'CMRSwitch', initialState, reducers: { resetValue: () => initialState, toggleValue: (state) => { state.switchIsChecked = !state.switchIsChecked; }, toggleDisabled: (state) => { state.switchIsDisabled = !state.switchIsDisabled; }, }, }); // Actions export const CMRSwitchActions = CMRSwitchSlice.actions; // Selector export const selectCMRSwitch = (state) => state.CMRSwitch; export default CMRSwitchSlice.reducer;