Snai3i-LandingPage-FormBuilder / frontend / src / app / slices / stormAccess.ts
stormAccess.ts
Raw
import { createSlice } from "@reduxjs/toolkit";

const initial_state: boolean = false;

const stormAccessSlice = createSlice({
  name: "stormAccess",
  initialState: initial_state,
  reducers: {
    allowAccess: (_state) => {
      _state = true;
      return true;
    },
    disallowAccess: (_state) => {
      _state = false;
      return false;
    },
  },
});

export const { allowAccess, disallowAccess } = stormAccessSlice.actions;
export default stormAccessSlice.reducer;