Skip to content

Commit

Permalink
docs: explain difference between @Placeholder and @Loading (#54779)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eluchsinger authored and dylhunn committed Mar 27, 2024
1 parent 1af2be9 commit 519e781
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adev/src/content/guide/defer.md
Expand Up @@ -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.

Expand Down

0 comments on commit 519e781

Please sign in to comment.