D
D
Dmitry2017-04-21 00:03:39
JavaScript
Dmitry, 2017-04-21 00:03:39

Where to place Vue app logic when using shared store?

There is an application, which is a list of comments with an infinite nesting.
When creating a response to any of the comments, regardless of nesting, you must send a POST to create an entry in the database and insert an instance of the created comment into the parent or root.
I suppose that you can put this logic in store action :
- describe a mutation to add an item to the general list of comments
- make a request to add to the database
- upon successful entry to the database - commit the mutation to add to the parent object or to the root
The application looks like this:
i.imgur.com/CUJqgwE.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2017-04-21
@another_dream

Your assumption is correct)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question