B
B
BonBon Slick2020-02-07 11:01:04
redux
BonBon Slick, 2020-02-07 11:01:04

Procedural vs OOP Vuex/Redux?

I was thinking, in all the examples on the git and the same documentation, everything is divided into files and there is not a single example where the StateMachine is implemented with Objects. And I thought, because there was a problem that could be solved by simply expanding an existing method in another module, and so I had to extend / merge modules and rewrite the necessary method from scratch.

Examples of docks and gita . In the git example, action, mutations and so on are in one module file, however this leads to very fast pollution, it is not clear what and where, but the essence and questions are the same.

  1. Why is there no OOP for StateMachine in JS?
  2. Why do docks use simple export?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-02-07
@BonBonSlick

the documentation is all divided into files and there is not a single example where the StateMachine is implemented with Objects

Documentation should be easy to read and understand. The examples may not be quite close to reality, but this is to make it easier for the reader.
git example action, mutations and so on in one module file

The thing is, in the case of Vue, you can organize your project however you want. As you wish. It is very flexible and does not impose any restrictions on the structure of the project.
We can put only modules into a separate file, or separate mutations and actions, or a file for each function, or put everything in one file. It all depends on your preferences and the specifics of the project. As your heart desires.
Why is there no OOP for StateMachine in JS?

I believe that OOP is not so flexible. And this is very important for the framework.
Why do docks use simple export?

regular export. Specification. And which one should?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question