You are here

function hook_event_dispatcher_js_alter in Hook Event Dispatcher 8

Implements hook_js_alter().

2 calls to hook_event_dispatcher_js_alter()
JsAlterEventTest::testJsAlterEventByReference in tests/src/Unit/Theme/JsAlterEventTest.php
JsAlterEvent by reference test.
JsAlterEventTest::testJsAlterEventBySet in tests/src/Unit/Theme/JsAlterEventTest.php
JsAlterEvent by set test.

File

./hook_event_dispatcher.module, line 786
Hook event dispatcher module.

Code

function hook_event_dispatcher_js_alter(array &$javascript, AttachedAssetsInterface $assets) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = \Drupal::service('hook_event_dispatcher.manager');
  $event = new JsAlterEvent($javascript, $assets);
  $manager
    ->register($event);
}