Answer the question
In order to leave comments, you need to log in
Who should handle the gulp stream in mvc?
Tell me who should handle gulp flow in mvc, controller or model?
And add some explanation.
I apologize for NOT explaining, when there is a picture of what is happening in my head, it seems that others should see it too.
I make my plugin (more precisely, I finish it) where the stream drives data about files, I have to process this stream and save the resulting data in the model. That is, the flow I need in the model. Each file processed in the model, the model dispatches an event and the view reads the given file from the file system and, if necessary, writes the collected data to the specified file. If it seems to someone that it is not a matter of the species to collect data, then here I can only say that only the species should be involved in any data that relates only to the species.
Why a view refers to data is only because it writes it afterward to a file that is displayed in the editor.
Wow... But I have three problems with this, the first of which is what is the data flow from gulp and the second is how this data should get into the model.
Answer the question
In order to leave comments, you need to log in
the gulp thread must process gulp or its planins. What about MVC?
I understand that you want to organize something like an asset manager that compiles all the assets using gulp. In this case, our asset manager is a service. Pulling services is the task of the controller (controllers are different, here we are talking about the front controller, the entry point). It is possible to implement a dump of assets separately from the application, for example, when warming the cache.
In any case, MVC has nothing to do with it. It is not part of the view and not part of the model. Either the front controller, which is directly involved in processing requests, or some kind of assembly mechanism. And even better - just collect assets at a gallop.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question