Alternative for hook_node_submit() What is an alternative to hook_node_submit() for Drupal 8?
This is what the related change record has to say:


  Instead of the submit hook, an #entity_builder callback should be used to map form values to an entity (or better; use a field with a widget). If the submit hook is not about mapping values to the entity, register a custom #submit callback on the submit button and put your logic there.


And here are the related code samples:

// Implements HOOK_form_BASE_FORM_ID_alter
function mymodule_form_node_form_alter(&amp;$form, FormStateInterface $form_state) {
  // For entity builders.
  $form['#entity_builders'][] = 'mymodule_node_builder';
  // For submit callbacks.
  $form['actions']['submit']['#submit'][] = 'mymodule_node_form_submit';
}

function mymodule_node_builder($entity_type, NodeInterface $node, &amp;$form, FormStateInterface $form_state) {
  $parent = $form_state-&gt;getValue('menu', 'parent');
  if ($parent) {
    list($node-&gt;menu['menu_name'], $node-&gt;menu['plid']) = explode(':', $parent);
  }
}

function mymodule_node_form_submit($form, FormStateInterface $form_state) {
  $node = $form_state-&gt;getFormObject()-&gt;getEntity();
  mymodule_do_something($node);
}