Right now Html.php has a function which sets static::$isAjax
, which used only in the getUniqueId() function.
Exposing this through a isAjax()
function will allow modules to easily identify if they need to return a render array or an AjaxResponse.
I know that Drupal will send the rendered array through AJAX commands, but the commands have no selector provided and the alter hook for them provides no context either.