Skip to content

Commit 37c30be

Browse files
committed
update deps and support for dynamic redirects
1 parent 812a6e1 commit 37c30be

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
},
2828
"dependencies": {
2929
"react": "15.x.x",
30-
"router-async": "0.4.x"
30+
"router-async": "0.5.x"
3131
}
3232
}

src/browser-router.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default class BrowserRouter extends Router {
2626
};
2727
}
2828
async navigate(path, ctx = new Context()) {
29-
const { redirect, error } = await this.router.match({ path, ctx });
29+
const { redirect, error } = await this.router.resolve({ path, ctx });
3030
if (error === null) {
3131
if (redirect) {
3232
this.history.push(redirect);

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import RootRoute from './root-route';
66
import Middleware from './middleware';
77
import Redirect from './redirect';
88
import Placeholder from './placeholder';
9-
import { RouterError, Context } from 'router-async';
9+
import { Context, RouterError, DynamicRedirect } from 'router-async';
1010

1111
export {
1212
BrowserRouter,
@@ -17,6 +17,7 @@ export {
1717
Middleware,
1818
Redirect,
1919
Placeholder,
20+
Context,
2021
RouterError,
21-
Context
22+
DynamicRedirect
2223
};

yarn.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ isomorphic-fetch@^2.1.1:
4747
node-fetch "^1.0.1"
4848
whatwg-fetch ">=0.10.0"
4949

50-
js-tokens@^2.0.0:
51-
version "2.0.0"
52-
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5"
50+
js-tokens@^3.0.0:
51+
version "3.0.0"
52+
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.0.tgz#a2f2a969caae142fb3cd56228358c89366957bd1"
5353

5454
loose-envify@^1.0.0, loose-envify@^1.1.0:
55-
version "1.3.0"
56-
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.0.tgz#6b26248c42f6d4fa4b0d8542f78edfcde35642a8"
55+
version "1.3.1"
56+
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
5757
dependencies:
58-
js-tokens "^2.0.0"
58+
js-tokens "^3.0.0"
5959

6060
node-fetch@^1.0.1:
6161
version "1.6.3"
@@ -65,8 +65,8 @@ node-fetch@^1.0.1:
6565
is-stream "^1.0.1"
6666

6767
object-assign@^4.1.0:
68-
version "4.1.0"
69-
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0"
68+
version "4.1.1"
69+
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
7070

7171
path-to-regexp@^1.6.0:
7272
version "1.7.0"
@@ -81,8 +81,8 @@ promise@^7.1.1:
8181
asap "~2.0.3"
8282

8383
query-string@^4.2.3:
84-
version "4.2.3"
85-
resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.2.3.tgz#9f27273d207a25a8ee4c7b8c74dcd45d556db822"
84+
version "4.3.1"
85+
resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.1.tgz#54baada6713eafc92be75c47a731f2ebd09cd11d"
8686
dependencies:
8787
object-assign "^4.1.0"
8888
strict-uri-encode "^1.0.0"
@@ -95,9 +95,9 @@ [email protected]:
9595
loose-envify "^1.1.0"
9696
object-assign "^4.1.0"
9797

98-
router-async@0.4.x:
99-
version "0.4.1"
100-
resolved "https://registry.yarnpkg.com/router-async/-/router-async-0.4.1.tgz#f4a9403df1664544005f67961bde3e87b6802b82"
98+
router-async@0.5.x:
99+
version "0.5.2"
100+
resolved "https://registry.yarnpkg.com/router-async/-/router-async-0.5.2.tgz#6b0c5448de137dfb425798a51d5d6ce7cc312161"
101101
dependencies:
102102
path-to-regexp "^1.6.0"
103103
query-string "^4.2.3"

0 commit comments

Comments
 (0)