Function addNavigationListener

  • Adds a listener to the popstate event executed each time the event is fired. This function is designed to be used in conjunction with the Router.resolve method.

    Parameters

    • listener: ((path: string) => void)

      The listener callback.

        • (path): void
        • Parameters

          • path: string

            The path to navigate to.

          Returns void

    • Optionaloptions: AddEventListenerOptions

      The optional parameter to customize the behavior of the listener. It supports all the parameters of addEventListener function.

    Returns void

  • Adds a listener to the popstate event executed each time the event is fired. This function is designed to be used in conjunction with the Router.resolve method.

    Type Parameters

    Parameters

    • listener: ((path: string, context: C extends EmptyObject
          ? never
          : C) => void)

      The listener callback.

        • (path, context): void
        • Parameters

          • path: string

            The path to navigate to.

          • context: C extends EmptyObject
                ? never
                : C

            Any data that needs to be sent to Route.action. The type of this parameter should match the generic C. If C is not provided or is equal to EmptyObject, providing this parameter is forbidden.

          Returns void

    • Optionaloptions: AddEventListenerOptions

      The optional parameter to customize the behavior of the listener. It supports all the parameters of addEventListener function.

    Returns void