What is the difference between the Marionette Application.execute and Application.trigger methods?

According to docs, it Marionette.Application provides three methods of action:

  • Application.execute - perform an action, but first register it with MyApp.command('action', function () {});
  • Application.request- it’s like Application.execute, but it can return something
  • Application.trigger- this is the same as Application.execute.

What is the difference between Application.triggerand Application.execute?

+4
source share
1 answer

When A calls execute, he orders B to do something. There is a somewhat direct link: one orders, the other executes (that is, something must happen).

, -, . , , ( ). , / .

triggerMethod Marionnette: "some: event", onSomeEvent, . , myView.triggerMethod("some:event") "some: event" myView myView.onSomeEvent.

+8

Source: https://habr.com/ru/post/1524916/


All Articles