docs: def only_once(action=None):
      """
      .. deprecated:: 0.5.0
         Use :func:`when_not` in combination with :func:`set_state` instead. This
         handler is deprecated because it might actually be
         `called multiple times <https://github.com/juju-solutions/charms.reactive/issues/22>`_.
  
      Register the decorated function to be run once, and only once.
  
      This decorator will never cause arguments to be passed to the handler.
      """
      if action is None:
          # allow to be used as @only_once or @only_once()
          return only_once
  
      action_id = _action_id(action)
      handler = Handler.get(action)
      handler.add_predicate(lambda: not was_invoked(action_id))
      handler.add_post_callback(partial(mark_invoked, action_id))
      return action