26 lines
872 B
JavaScript
26 lines
872 B
JavaScript
import { getStoreFactory } from "./routerStores.js";
|
|
import { RouterCore } from "@tanstack/router-core";
|
|
//#region src/router.ts
|
|
/**
|
|
* Creates a new Router instance for React.
|
|
*
|
|
* Pass the returned router to `RouterProvider` to enable routing.
|
|
* Notable options: `routeTree` (your route definitions) and `context`
|
|
* (required if the root route was created with `createRootRouteWithContext`).
|
|
*
|
|
* @param options Router options used to configure the router.
|
|
* @returns A Router instance to be provided to `RouterProvider`.
|
|
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
|
|
*/
|
|
var createRouter = (options) => {
|
|
return new Router(options);
|
|
};
|
|
var Router = class extends RouterCore {
|
|
constructor(options) {
|
|
super(options, getStoreFactory);
|
|
}
|
|
};
|
|
//#endregion
|
|
export { Router, createRouter };
|
|
|
|
//# sourceMappingURL=router.js.map
|