Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up getters with parameters passed #52

Open
ghost opened this issue Apr 16, 2019 · 1 comment · May be fixed by #63
Open

Setting up getters with parameters passed #52

ghost opened this issue Apr 16, 2019 · 1 comment · May be fixed by #63

Comments

@ghost
Copy link

ghost commented Apr 16, 2019

Is it possible to setup @Getter to get the following output?

computed: {
    collectionCategoryObjects() {
         return this.$store.getters["entities/collections/getCollectionCategoryObjects"]({
		department: this.department,
		collectionTitle: this.collectionTitle
	})
    }
}

How can I create @Getter in a compact format?
Is there a way to setup a getter that is less verbose than this?

const Ncollection = namespace('entities/collections')
// ... class .. {
@Ncollection@Getter("getCollectionCategoryObjects") getterCollection: any
get Collection() {
	return this.getterCollection({
		department: this.department,
		collectionTitle: this.collectionTitle
	})
}
@AndreLion
Copy link

In other words, please support curry getter

this.$store.getters['curryGetter'](someParam)

in vuex-class.

See details in How to pass parameters to the function in getters

@hisuwh hisuwh linked a pull request Oct 12, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant