@kodaris/krubble-app-components 1.0.148 → 1.0.149

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.
@@ -12358,9 +12358,20 @@ class KRRouter {
12358
12358
  // its element so the whole chain can be merged once they've all settled.
12359
12359
  Promise.all(matched.routes.map(match => {
12360
12360
  // Reuse the cached element for this url if we have one. Its data is cached with it — resolve()
12361
- // doesn't run again, but the level still has to contribute to the merge below.
12361
+ // doesn't run again unless the route asks for it with runResolvers: 'always' — but the level still
12362
+ // has to contribute to the merge below.
12362
12363
  const cached = KRRouter.routeCache.get(match.url);
12363
12364
  if (cached) {
12365
+ const cachedConstructor = customElements.get(match.route.component);
12366
+ if (match.route.runResolvers === 'always' && cachedConstructor && typeof cachedConstructor.resolve === 'function') {
12367
+ return Promise.resolve(cachedConstructor.resolve(KRRouter.getParams())).then(data => {
12368
+ cached.data = data;
12369
+ return {
12370
+ el: cached.el,
12371
+ data,
12372
+ };
12373
+ });
12374
+ }
12364
12375
  return Promise.resolve({
12365
12376
  el: cached.el,
12366
12377
  data: cached.data,