Passed
Push — main ( 8a25dd...3c103b )
by TARIQ
12:48
created

admin/src/stores/counter.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 16
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 16
c 0
b 0
f 0
rs 10
wmc 3
mnd 0
bc 0
fnc 3
bpm 0
cpm 1
noi 0
1
import { defineStore } from 'pinia'
2
3
export const useCounterStore = defineStore({
4
  id: 'counter',
5
  state: () => ({
6
    counter: 0
7
  }),
8
  getters: {
9
    doubleCount: (state) => state.counter * 2
10
  },
11
  actions: {
12
    increment() {
13
      this.counter++
14
    }
15
  }
16
})
17