static __registerAction(action, target) {
    const { name, do: _do, undo } = action;
    if (typeof name !== 'string') throw new Error('name must be a string');
    if (typeof _do !== 'function') throw new Error('do must be a function');
    this.deleteExistingHook(target, 'actions', name);

    // make sure to trigger the setter
    target.hooks = deepmerge(target.hooks, {
      actions: {
        [name]: {
          do: _do,
          undo,
        },
      },
    });
    return target;
  }
@param {Action} action
@param {typeof Register | Register} target