From d201c58b44da71339b9a48a169bcdd4cb8c0398e Mon Sep 17 00:00:00 2001 From: Esteban Luchsinger Date: Fri, 8 Mar 2024 16:40:31 +0100 Subject: [PATCH] docs: explain difference between @placeholder and @loading (#54779) Add a sentence to the `@loading` block documentation that emphasizes more that the `@loading` block will replace the `@placeholder` block once the deferred view starts loading. PR Close #54779 --- adev/src/content/guide/defer.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adev/src/content/guide/defer.md b/adev/src/content/guide/defer.md index 52110e6d6b0c66..eb6e7346a99532 100644 --- a/adev/src/content/guide/defer.md +++ b/adev/src/content/guide/defer.md @@ -56,7 +56,9 @@ Note: Certain triggers may require the presence of either a `@placeholder` or a ### `@loading` -The `@loading` block is an optional block that allows you to declare content that will be shown during the loading of any deferred dependencies. For example, you could show a loading spinner. Similar to `@placeholder`, the dependencies of the `@loading` block are eagerly loaded. +The `@loading` block is an optional block that allows you to declare content that will be shown during the loading of any deferred dependencies. Its dependences are eagerly loaded (similar to `@placeholder`). + +For example, you could show a loading spinner. Once loading has been triggered, the `@loading` block replaces the `@placeholder` block. The `@loading` block accepts two optional parameters to specify the `minimum` amount of time that this placeholder should be shown and amount of time to wait `after` loading begins before showing the loading template. `minimum` and `after` parameters are specified in time increments of milliseconds (ms) or seconds (s). Just like `@placeholder`, these parameters exist to prevent fast flickering of content in the case that the deferred dependencies are fetched quickly. Both the `minimum` and `after` timers for the `@loading` block begins immediately after the loading has been triggered.