eVinAu
Router preload and cache.set don't seem to be working
Found the bug in my cache usage: when I was manually setting the cache, I was using the id property of my events, which is a number, but when the load functions runs as a result of browser navigation, the params passed in are obviously strings, so I wasn't actually accessing the same key. With a simple .toString() when manually setting the cache, I get the behaviour I want.
4 replies
Router preload and cache.set don't seem to be working
Ok, I think the issue with the preload is that all the preload stuff is not set up to deal with a HashRouter. Squinting at the source code, it seems like the event handling and preload handling stuff relies on interpreting url.pathname from the corresponding anchor element. For my HashRouter, though, the pathname is just "/", which isn't recognised by the event handlers as a path that needs checking for preloads and doesn't match any branches within the preloadRoute function.
4 replies