public function onTwigView(ViewEvent $event)
    {
        $view = $event->getView();

        if (function_exists('drupal_add_library') && $view instanceof TwigView) {
            drupal_add_library('calista', 'calista_page');
            /*
            if ($event->getView()->visualSearchIsEnabled()) {
                drupal_add_library('calista', 'calista_search');
            }
             */
        }
    }
public function onTwigView(ViewEvent $event)
    {
        $view = $event->getView();

        if (function_exists('drupal_add_library') && $view instanceof TwigView) {
            drupal_add_library('calista', 'calista_page');
            /*
            if ($event->getView()->visualSearchIsEnabled()) {
                drupal_add_library('calista', 'calista_search');
            }
             */
        }
    }
public function onTwigView ( ViewEvent $ event ) { $ view = $ event -> getView ( ) ; if ( function_exists ( 'drupal_add_library' ) && $ view instanceof TwigView ) { drupal_add_library ( 'calista' , 'calista_page' ) ; /*
            if ($event->getView()->visualSearchIsEnabled()) {
                drupal_add_library('calista', 'calista_search');
            }
             */ } }
Add JS libraries

@param ViewEvent $event
Add JS libraries