canjs / can-route

Observable front-end application routing for CanJS.
https://canjs.com/doc/can-route.html
MIT License
10 stars 4 forks source link

route.register should not read route.data #255

Closed phillipskevin closed 4 years ago

phillipskevin commented 4 years ago

v5.0.1 added a warning when route.data is set after route.register is called.

This warning is necessary because default property values are sometimes set when register is called:

https://github.com/canjs/can-route/blob/master/src/register.js#L107-L121

We should move this logic into route.start so that this warning is not necessary and route.data can be set before or after routes are registered.

This was suggested in https://bitovi-community.slack.com/archives/CFC22NZ8A/p1573741447027600