@viewfly/router 0.0.31 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsx, Fragment } from '@viewfly/core/jsx-runtime';
2
- import { Injectable, inject, useSignal, onDestroy, provide } from '@viewfly/core';
2
+ import { Injectable, inject, useSignal, onUnmounted, provide } from '@viewfly/core';
3
3
  import { Subject, Subscription, fromEvent } from '@tanbo/stream';
4
4
 
5
5
  /******************************************************************************
@@ -243,7 +243,7 @@ function Link(props) {
243
243
  const subscription = navigator.onUrlChanged.subscribe(() => {
244
244
  isActive.set(getActive());
245
245
  });
246
- onDestroy(() => {
246
+ onUnmounted(() => {
247
247
  subscription.unsubscribe();
248
248
  });
249
249
  function navigate(ev) {
@@ -287,7 +287,7 @@ function RootRouter(props) {
287
287
  const subscription = navigator.onUrlChanged.subscribe(() => {
288
288
  router.refresh(getPath());
289
289
  });
290
- onDestroy(() => {
290
+ onUnmounted(() => {
291
291
  subscription.unsubscribe();
292
292
  navigator.destroy();
293
293
  });
@@ -307,7 +307,7 @@ function RouterOutlet(props) {
307
307
  const subscription = router.onRefresh.subscribe(() => {
308
308
  updateChildren();
309
309
  });
310
- onDestroy(() => {
310
+ onUnmounted(() => {
311
311
  subscription.unsubscribe();
312
312
  });
313
313
  let currentComponent = null;
package/bundles/index.js CHANGED
@@ -245,7 +245,7 @@ function Link(props) {
245
245
  const subscription = navigator.onUrlChanged.subscribe(() => {
246
246
  isActive.set(getActive());
247
247
  });
248
- core.onDestroy(() => {
248
+ core.onUnmounted(() => {
249
249
  subscription.unsubscribe();
250
250
  });
251
251
  function navigate(ev) {
@@ -289,7 +289,7 @@ function RootRouter(props) {
289
289
  const subscription = navigator.onUrlChanged.subscribe(() => {
290
290
  router.refresh(getPath());
291
291
  });
292
- core.onDestroy(() => {
292
+ core.onUnmounted(() => {
293
293
  subscription.unsubscribe();
294
294
  navigator.destroy();
295
295
  });
@@ -309,7 +309,7 @@ function RouterOutlet(props) {
309
309
  const subscription = router.onRefresh.subscribe(() => {
310
310
  updateChildren();
311
311
  });
312
- core.onDestroy(() => {
312
+ core.onUnmounted(() => {
313
313
  subscription.unsubscribe();
314
314
  });
315
315
  let currentComponent = null;
package/bundles/link.d.ts CHANGED
@@ -7,4 +7,4 @@ export interface LinkProps extends Props {
7
7
  queryParams?: QueryParams;
8
8
  tag?: string;
9
9
  }
10
- export declare function Link(props: LinkProps): () => any;
10
+ export declare function Link(props: LinkProps): () => import("@viewfly/core/jsx-runtime").JSX.Element;
@@ -3,4 +3,4 @@ export interface RootRouterProps extends Props {
3
3
  basePath?: string;
4
4
  children?: JSXInternal.JSXNode;
5
5
  }
6
- export declare function RootRouter(props: RootRouterProps): () => any;
6
+ export declare function RootRouter(props: RootRouterProps): () => import("@viewfly/core/jsx-runtime").JSX.Element;
@@ -3,4 +3,4 @@ import { RouteConfig } from './providers/_api';
3
3
  export interface RouterOutletProps extends Props {
4
4
  config: RouteConfig[];
5
5
  }
6
- export declare function RouterOutlet(props: RouterOutletProps): () => any;
6
+ export declare function RouterOutlet(props: RouterOutletProps): () => import("@viewfly/core/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/router",
3
- "version": "0.0.31",
3
+ "version": "0.1.0",
4
4
  "description": "A routing library based on the Viewfly framework that can be run in the browser or Nodejs background.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -13,7 +13,7 @@
13
13
  "keywords": [],
14
14
  "dependencies": {
15
15
  "@tanbo/stream": "^1.2.3",
16
- "@viewfly/core": "^0.0.31",
16
+ "@viewfly/core": "^0.1.0",
17
17
  "url": "^0.11.1"
18
18
  },
19
19
  "devDependencies": {
@@ -34,5 +34,5 @@
34
34
  "bugs": {
35
35
  "url": "https://github.com/viewfly/viewfly.git/issues"
36
36
  },
37
- "gitHead": "cb3bcc1d390c6ee85411c1713f966b3d50f6e066"
37
+ "gitHead": "790bb591abb02c500f54c579c7783da66a999b87"
38
38
  }