Skip to content

Commit a34c3d9

Browse files
fix(pinia): passing getters on inspectorStateUpdated (#122)
1 parent f04ff0e commit a34c3d9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

packages/core/src/bridge/devtools.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class BridgeRpc {
5252
const _payload = parse(payload)
5353
options.inspectorId === _payload.inspectorId && cb({
5454
state: _payload.state,
55+
getters: _payload.getters,
5556
} as T)
5657
})
5758
},

packages/playground/src/App.preview.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ const app = useAppStore()
1616
<p>
1717
Pinia State Count: {{ app.count }}
1818
</p>
19+
<p>
20+
Pinia Getter DoubledCount: {{ app.doubledCount }}
21+
</p>
1922
<button @click="app.increment">
2023
Increment Count (Pinia)
2124
</button>

packages/playground/src/stores/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { defineStore } from 'pinia'
2-
import { ref } from 'vue'
2+
import { computed, ref } from 'vue'
33

44
export const useAppStore = defineStore('app', () => {
55
const count = ref(120)
66
function increment() {
77
count.value++
88
}
9+
const doubledCount = computed(() => count.value * 2)
910

10-
return { count, increment }
11+
return { count, doubledCount, increment }
1112
})
1213

1314
export const useCounterStore = defineStore('counter', () => {

0 commit comments

Comments
 (0)