@kodaris/krubble-app-components 1.0.148 → 1.0.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12361,9 +12361,20 @@
12361
12361
  // its element so the whole chain can be merged once they've all settled.
12362
12362
  Promise.all(matched.routes.map(match => {
12363
12363
  // Reuse the cached element for this url if we have one. Its data is cached with it — resolve()
12364
- // doesn't run again, but the level still has to contribute to the merge below.
12364
+ // doesn't run again unless the route asks for it with runResolvers: 'always' — but the level still
12365
+ // has to contribute to the merge below.
12365
12366
  const cached = KRRouter.routeCache.get(match.url);
12366
12367
  if (cached) {
12368
+ const cachedConstructor = customElements.get(match.route.component);
12369
+ if (match.route.runResolvers === 'always' && cachedConstructor && typeof cachedConstructor.resolve === 'function') {
12370
+ return Promise.resolve(cachedConstructor.resolve(KRRouter.getParams())).then(data => {
12371
+ cached.data = data;
12372
+ return {
12373
+ el: cached.el,
12374
+ data,
12375
+ };
12376
+ });
12377
+ }
12367
12378
  return Promise.resolve({
12368
12379
  el: cached.el,
12369
12380
  data: cached.data,