J
J
JonGalt2018-04-10 08:51:44
API
JonGalt, 2018-04-10 08:51:44

How to organize vue interaction with api?

Started learning vue js. Went to the organization of the internal storage organized using Vuex.
1. The question is what data should be stored in the store?
1.1 Data related to a specific user?
2. If another user changed the data in the database on the backend, then this data will not be updated in the store of the first user?
3. If so, then it's probably better to make mixins with methods of interacting with Api
4. Or can someone explain how to organize interaction with api in a multi-user application

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
E, 2018-04-10
@aylo

1. data with which you will work, display on the front or compare something with something.
1.1. depending on what you want to do for others, for example, if there is a list of users, then you will have to store a list of all users, but with specific fields, for example ID / username / email, and for the current user you will store more advanced properties
2. will not be updated just like that
3 .xs
4. if you need all data to be updated real-time, use data synchronization, for example, through sockets, as a socket.io option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question