---
# System prepended metadata

title: Lazy Loading constants
tags: [$ and QRL]

---

# Lazy Loading constants

> * 如有錯誤處指正或任何建議，懇請留言，感謝!
> * 搭配 ChatGPT 進行翻譯，請小心服用
> * ▸ ... 為英文原文


:::spoiler ...
The Optimizer can be used to lazy-load data, not just functions. The benefit of doing that is that lazy loading any part of your application becomes easy.

Use the stand-alone `$()` function to mark the data that you wish to lazy load. The `$()` function returns a `QRL` that is a reference that can be serialized by Qwik and that can later be resolved into the original value.

### Example

Load the data representing the message lazily as part of the click listener.

For this exercise imagine that we wish to lazy load the `'Hello World!'` string. Use the `$()` function to mark the string as lazy-loadable. Then use `await` to resolve the lazy-loadable value.

Go to the `Symbols` tab and examine how the code was broken down into parts.

::: 


###### tags: `$ and QRL`