Class DefaultResolver<Attrs, Comp, RouteArgs>

Generates a route resolver for a given component.

In addition to regular route resolver functionality:

  • It provide the current route name as an attr
  • It sets a key on the component so a rerender will be triggered on route change.

Type Parameters

  • Attrs extends ComponentAttrs

  • Comp extends Component<Attrs & {
        routeName: string;
    }>

  • RouteArgs extends Record<string, unknown> = {}

Hierarchy

Implements

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • Attrs extends ComponentAttrs<Attrs>

    • Comp extends Component<Attrs & {
          routeName: string;
      }, undefined, Comp>

    • RouteArgs extends Record<string, unknown> = {}

    Parameters

    • component: (new () => Comp)
        • new (): Comp
        • Returns Comp

    • routeName: string

    Returns DefaultResolver<Attrs, Comp, RouteArgs>

Properties

component: (new () => Comp)

Type declaration

    • new (): Comp
    • Returns Comp

routeName: string

Methods

  • Parameters

    • vnode: Vnode<Attrs, Comp>

    Returns Attrs & {
        routeName: string;
    }

  • When a route change results in a changed key, a full page rerender occurs. This method can be overriden in subclasses to prevent rerenders on some route changes.

    Returns string

Generated using TypeDoc v0.23.24