B
B
Bogdan2018-02-28 11:34:13
Vue.js
Bogdan, 2018-02-28 11:34:13

Where is the right place to store custom functions?

Hello. Tell me please. And where is it right to store custom functions, for example, I wrote my wrapper over fetch for AJAX requests? Now I store in actions VUEX. Or is it more correct to make a separate file and import it into each component where AJAX will be called?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akass, 2018-02-28
@akass

Yes, take it out to api.js and use it where necessary.
https://metricloop.com/blog/how-to-make-api-calls-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question