Skip to content

Commit

Permalink
feat(router): adjust exported type
Browse files Browse the repository at this point in the history
  • Loading branch information
megheaiulian committed Jan 11, 2024
1 parent 9efdcb6 commit 8c4d472
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/router.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { nothing } from 'lit-html';

Check warning on line 1 in src/router.ts

View workflow job for this annotation

GitHub Actions / build / build

'lit-html' should be listed in the project's dependencies. Run 'npm i -S lit-html' to add it
import { guard } from 'lit-html/directives/guard.js';
import type { DirectiveResult } from 'lit-html/directive.js';
import { guard, GuardDirective } from 'lit-html/directives/guard.js';

Check warning on line 3 in src/router.ts

View workflow job for this annotation

GitHub Actions / build / build

'lit-html' should be listed in the project's dependencies. Run 'npm i -S lit-html' to add it
import { until } from 'lit-html/directives/until.js';

Check warning on line 4 in src/router.ts

View workflow job for this annotation

GitHub Actions / build / build

'lit-html' should be listed in the project's dependencies. Run 'npm i -S lit-html' to add it
import { component } from '@pionjs/pion';

Expand All @@ -11,7 +12,7 @@ interface Props {
}
interface RouterT extends HTMLElement, Props {}

const Router = (host: RouterT) => {
const Router = (host: RouterT): DirectiveResult<typeof GuardDirective> => {
const routes: Route[] = host.routes,
{ route, result } = useRouter(routes);

Expand All @@ -20,8 +21,8 @@ const Router = (host: RouterT) => {
return guard([result], () =>
until(
Promise.resolve(result).catch(() => nothing),
nothing
)
nothing,
),
);
};

Expand Down

0 comments on commit 8c4d472

Please sign in to comment.