Skip to content
Snippets Groups Projects
Select Git revision
  • d13819210680870d3a75fc8d040a2d9f3a039207
  • main default protected
2 results

treeSlotsSlice.js

Blame
  • treeSlotsSlice.js 458 B
    import { createSlice } from '@reduxjs/toolkit';
    
    const treeSlotsSlice = createSlice({
      name: 'treeSlots',
      initialState: {},
      reducers: {
        loadTree: (treeSlots, action) => {
          const {
            slot,
            treeName,
          } = action.payload;
          treeSlots[slot] = treeName;
        },
      },
    });
    export default treeSlotsSlice;
    
    export const { loadTree } = treeSlotsSlice.actions;
    
    export function selectTreesBySlot(state) {
      return state.treeSlots;
    }