Passed
Pull Request — master (#25)
by Hamed
01:17
created

counter.js ➔ increment   A

Complexity

Conditions 3

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 3
1
import { ref, computed } from 'vue'
2
import { defineStore } from 'pinia'
3
4
export const useCounterStore = defineStore('counter', () => {
5
  const count = ref(0)
6
  const doubleCount = computed(() => count.value * 2)
7
  function increment() {
0 ignored issues
show
Bug introduced by
The function increment is declared conditionally. This is not supported by all runtimes. Consider moving it to root scope or using var increment = function() { /* ... */ }; instead.
Loading history...
8
    count.value++
9
  }
10
11
  return { count, doubleCount, increment }
12
})
13