Skip to content
Snippets Groups Projects
Select Git revision
  • a653b0de5f805e754b2ccbb6d3833e127fa96ec5
  • master default
  • develop
  • git-fixes
  • 4.1_templates-symlink
  • 4.0_templates
6 results

index.php

Blame
  • counterSlice.js 444 B
    import { createSlice } from '@reduxjs/toolkit';
    
    const counterSlice = createSlice({
      name: 'counter',
      initialState: {
        value: 0,
      },
      reducers: {
        setValue: (counter, action) => {
          const {
            value,
          } = action.payload;
          counter.value = value;
        },
      },
    });
    export default counterSlice;
    
    export const {
      setValue,
    } = counterSlice.actions;
    
    export function selectValue(state) {
      return state.counter.value;
    }