HabitatMap/AirCasting

View on GitHub
app/javascript/react/store/realtimeMapUpdatesSlice.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { createSlice, PayloadAction } from "@reduxjs/toolkit";

interface RealtimeMapUpdatesState {
  realtimeMapUpdates: boolean;
}

const initialState: RealtimeMapUpdatesState = {
  realtimeMapUpdates: false,
};

const realtimeMapUpdatesSlice = createSlice({
  name: "realtimeMapUpdates",
  initialState,
  reducers: {
    setRealtimeMapUpdates(state, action: PayloadAction<boolean>) {
      state.realtimeMapUpdates = action.payload;
    },
  },
});

export const { setRealtimeMapUpdates } = realtimeMapUpdatesSlice.actions;
export default realtimeMapUpdatesSlice.reducer;