-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RouterEventType is no longer exported? #44
Comments
A work-around might be to do
Instead of
|
But other things have changed as well. If I have something like
Then previously a call to |
Export should work as of version |
Hmm. Perhaps I'm doing something wrong, but it doesn't seem to work for me
And then
|
It seems good here: JavaScript: TypeScript: Did you try uninstalling/installing it again?
|
I have added the following test to the latest current version: it('Should ', async (done) => {
const window = new MockWindow() as any
const app = create('test-router', window)
let hasClicked = false
app.path('/browse/:cname', (req, res) => {
const sub = app.events.subscribe(async event => {
if (event.type !== RouterEventType.ProgressEnd) {
return
}
if (hasClicked == true) {
done()
return
}
hasClicked = true
await app.navigate('/browse/b')
})
res.onLeave(() => sub.unsubscribe())
})
await app.load()
await app.navigate('/browse/a')
}) Does that cover your use case? If not, could you set up a code sandbox illustrating your case? |
Still doesn't work for me locally, but that must surely be some kind of mistake on my part. It seems to work out well elsewhere. 😄 W.r.t to my second problems, where links have to pressed twice to change, I've made a minimalistic example of it at https://codesandbox.io/s/sweet-taussig-2q3wb. You go "Home", press "foo", then keep pressing the links for "next". (I've somehow messed up the transitions, but that's another story) |
Thanks for taking the time to put together that sandbox! I'm working on it now. |
Just a quick update on this. app.events.subscribe(event => {
if (event.type !== "ROUTER_END") {
return
}
console.log(window.location.pathname)
console.log(req.params.name)
});
Looks like the |
You can check out this sandbox I'll be enhancing the documentation soon, but for now to access import crayon from 'crayon'
console.log(crayon.RouterEventType.ProgressStart) Let me know if you have any issues, otherwise I'll close this issue for now |
Previsouly you could do a
This no longer works. Where is it exported now?
The text was updated successfully, but these errors were encountered: