Skip to content

Commit 1411681

Browse files
committed
Add get<Item>FromStore to makeFindGetter
1 parent fb46f35 commit 1411681

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/make-get-mixin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export default function makeFindMixin(options) {
5353
const WATCH = `${prefix}Watch`
5454
const QUERY_WHEN = `${prefix}QueryWhen`
5555
const GET_ACTION = `get${capitalized}`
56+
const GET_GETTER = `get${capitalized}FromStore`
5657
const LOCAL = `${prefix}Local`
5758
const QID = `${prefix}Qid`
5859
const ID = `${prefix}Id`
@@ -74,6 +75,13 @@ export default function makeFindMixin(options) {
7475
},
7576
[QUERY_WHEN]() {
7677
return true
78+
},
79+
// Exposes `get<Item>FromStore`
80+
[GET_GETTER]() {
81+
return id => {
82+
const serviceName = this[SERVICE_NAME]
83+
return this.$store.getters[`${serviceName}/get`](id)
84+
}
7785
}
7886
},
7987
methods: {

0 commit comments

Comments
 (0)