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

Possible to return all methods? #18

Open
mberrg opened this issue Jul 28, 2020 · 2 comments
Open

Possible to return all methods? #18

mberrg opened this issue Jul 28, 2020 · 2 comments

Comments

@mberrg
Copy link

mberrg commented Jul 28, 2020

Why must we specify every method/object in use functions?

Currently you must specify the name twice:

const { fetch } = useActions(['fetch']);
const { article, comments } = useState(['article', 'comments']);

Why not do this instead?

const { fetch } = useActions();
const { article, comments } = useState();
@davidmeirlevy
Copy link
Contributor

Interesting.

This library (vuex-composition-helpers) is meant to be a bridge for the next Vuex API of Vuex 4 while using Vue 3.
All available methods here should be expected to work when Vuex will be out.

If you have any reason to believe that your idea will be part of the new Vuex 4 Composition API, I would like a reference to it, and of course, this idea will be implemented.

@mberrg
Copy link
Author

mberrg commented Jul 28, 2020

I've no reference to how this will work in Vuex 4 Composition Api, but normally when you make a "use-function" in the composition Api, you destruct the return without giving the names of the functions to the use-function.

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

No branches or pull requests

2 participants