Skip to content

Commit

Permalink
feat(router): export main api in index and auto init
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Jan 29, 2023
1 parent cf42205 commit 58718eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"esm",
"alwatr"
],
"main": "router.js",
"main": "index.js",
"type": "module",
"types": "router.d.ts",
"types": "index.d.ts",
"author": "S. Ali Mihandoost <[email protected]>",
"license": "MIT",
"files": [
Expand Down
11 changes: 11 additions & 0 deletions core/router/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
import {makeRouteContext, routeContextProvider} from './core.js';
import {clickTrigger} from './trigger-click.js';
import {popstateTrigger} from './trigger-popstate.js';

export {routerOutlet, routeContextConsumer, url, redirect} from './core.js';
export {clickTrigger, popstateTrigger};

clickTrigger.enable = popstateTrigger.enable = true;

if (routeContextProvider.getValue === undefined) {
routeContextProvider.setValue(makeRouteContext(), {debounce: 'Timeout'});
}

0 comments on commit 58718eb

Please sign in to comment.