new()

Creates a route handler module.

note: Route handler modules, which are used in client-side routing, aren’t the same as route handler functions, which are used in server-side routing.

Properties

Method Input Type Required/Optional Description
callback RouteHandlerCallback function Required A reference to a route handler callback. Each RouteHandlerCallback takes a RouteDestination object. Make sure to save the reference to this callback. RouteHandler.update invokes the callback to return the ViewSet for a given RouteDestination.

Syntax

constructor(callback: RouteHandlerCallback) {
        this.callback = callback; // Important: maintain a reference to the callback
    }

Signature

public void new(callback: RouteHandlerCallback)

Returns

  • None

See Also