-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Route title function isn't reactive #9
Comments
@nicooprat should be fixed now, please update to the latest release and let me know if it works on your end. |
Many thanks for your reactivity and your work! I can confirm it's now reactive, but... too much :) I set a debugger in my |
|
My code is like the one on the first comment. Yes the route is in a group, which has a default title() function by the way (which is not run in this case, as expected). Here's the trace:
Hope it helps. |
What browser that log from? Can't differ call from call. |
Please explain |
It's from Chrome 61. How could I get a better trace? I knew I wasn't clear :) Here's a sample of my code: const allRoutes = FlowRouter.group({
name: 'allRoutes',
title() {
// This is not run, as expected
return 'Default title'
}
}
allRoutes.route('/:storyId', {
name: 'story',
title({storyId}) {
// Runs a lot of times
const story = Stories.find(storyId).fetch()[0]
return story && story.title
}
}) |
Are you meant to use |
No it's meant to be like this, I have some routes where I don't set the title, so the default one is the group is set. I just meant to say that I'm actually using groups, but in my understanding it's not the cause of the issue, as it behaves as expected. By the way, a |
Then why don't you use const account = FlowRouter.group({
prefix: '/account',
title: "Account",
titlePrefix: 'Account > '
});
Mb using
If it's used in groups it will re-computed for each |
I was actually speaking of appending text, not prepending. Like « prefix > page - app title ». Unless I misunderstood its use? I’ll get that trace as soon as possible, afk for now, too bad we are not in the same timezone :D I’ll try without this group default title then. |
Well:
|
1:30 am at my zone :D |
Got you now... yeah, not possible now. Not sure if will be ever possible, I can detect first definition to add prepending text, but won't ever know if that one is the last one, thanks to the ability to nest groups |
Understood. Not sure if it’s really importan thought, that could even be something static, as I can’t really think of another use than for the global app title. But anyway, that’s not really important. |
And it will be difficult to keep title in the recommended range of 70 chars |
Here's a example of route definition:
I also tried
const story = Stories.find(storyId).fetch()
(without[0]
), or evenconst story = Stories.find(storyId)
, no luck. Thetitle()
function should run again when the cursor isn't empty anymore. Also tried with someSession.get()
tests, nothing happens neither.Thanks.
NB. This follows #6
The text was updated successfully, but these errors were encountered: