M
M
Mad Coder2021-11-27 00:21:14
Vue.js
Mad Coder, 2021-11-27 00:21:14

Is it correct to use action vuex for asynchronous requests without changing the state?

I wondered how correct it is to put the server api in an action that will not change the state? And then call these actions in the right places in the component.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sashqa, 2021-11-27
@Sashqa

Actions can contain any asynchronous code or business logic.
So you can safely use actions to call api without using mutations in them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question