Stone.js API
    Preparing search index...

    Class representing a Route Event.

    Hierarchy

    • Event
      • RouteEvent
    Index
    • Create an Event.

      Parameters

      • options: EventOptions

        The options to create an Event.

      Returns RouteEvent

    metadata: Record<string, unknown>

    The metadata associated with the event.

    source?: object

    The source of the event.

    timeStamp: number

    The timestamp of the event creation.

    type: string

    The type of the event.

    • Return a cloned instance.

      The metadata container is deep-copied (plain objects and arrays are recreated, special values kept by reference) so that mutating the clone's metadata — e.g. via middleware — never leaks back into the original event. This is what makes the Kernel's originalEvent snapshot a faithful pre-middleware copy.

      Returns this

      A cloned instance of the current class.

    • Get data from metadata.

      Type Parameters

      • TReturn = unknown

      Parameters

      • key: string

        The key to retrieve from metadata.

      Returns TReturn

      The value associated with the key or the fallback.

    • Get data from metadata.

      Type Parameters

      • TReturn = unknown

      Parameters

      • key: string

        The key to retrieve from metadata.

      • fallback: TReturn

        The fallback value if the key is not found.

      Returns TReturn

      The value associated with the key or the fallback.

    • Get data from metadata.

      Type Parameters

      • TReturn = unknown

      Parameters

      • key: string

        The key to retrieve from metadata.

      Returns TReturn

      The value associated with the key or the fallback.

    • Get data from metadata.

      Type Parameters

      • TReturn = unknown

      Parameters

      • key: string

        The key to retrieve from metadata.

      • fallback: TReturn

        The fallback value if the key is not found.

      Returns TReturn

      The value associated with the key or the fallback.

    • Check if the given value is equal to the specified value.

      Parameters

      • key: string

        The key to check.

      • value: unknown

        The value to compare against.

      Returns boolean

      True if the key's value is equal to the specified value, false otherwise.

    • Add data to metadata.

      Parameters

      • key: string | Record<string, unknown>

        The key or object to add to metadata.

      • Optionalvalue: unknown

        The value to associate with the key.

      Returns this

      This Event instance.

    • Create a RouteEvent.

      Parameters

      • options: EventOptions

        The options to create a RouteEvent.

      Returns RouteEvent

      A new RouteEvent instance.

    ROUTED: string = 'stonejs@router:routed'

    ROUTE_MATCHED Event name, fires after event matched route.

    RouteEvent#ROUTE_MATCHED

    ROUTING: string = 'stonejs@router:routing'

    ROUTING Event name, fires before event match route.

    RouteEvent#ROUTING