> For the complete documentation index, see [llms.txt](https://cbwire.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cbwire.ortusbooks.com/v2-1/essentials/computed-properties/computed-properties-proxied.md).

# Computed Properties ( Proxied )

Create dynamic properties for your UI Wires.

{% hint style="warning" %}
You must be on CBWIRE version 2.3.5 or later and enable the [Configuration](/v2-1/essentials/configuration.md) setting **useComputedPropertiesProxy** to follow this guide.

Otherwise, please follow [this guide](/v2-1/essentials/computed-properties.md) instead.
{% endhint %}

{% hint style="success" %}
In CBWIRE 2.3.5, we introduced the ability to proxy Computed Properties, which offers several advantages, including:

* Computed Properties are passed around as closures and are only rendered when called.
* The ability to invoke Computed Properties anywhere they are needed (both Actions and Templates).
* The ability to cache Computed Property results to enhance performance.
  {% endhint %}

Computed Properties are dynamic properties and help derive values from a database or another persistent store like a cache.&#x20;

Computed Properties are similar to [Data Properties](/v2-1/essentials/properties.md) with some key differences:

* They are declared as inline functions using `computed`.
* They can return any CFML value or object.

## Defining Properties

Define Computed Properties in your [Wires](/v2-1/essentials/creating-components.md) using `computed`.&#x20;

```javascript
component extends="cbwire.models.Component" {

    property name="taskService" inject="taskService@myapp";

    // Computed Properties
    computed = {
        "allTasks": function() {
            return taskService.getAll();
        }
    };
}

```

## Accessing From Actions

You can access your Computed Properties from within your [Actions](/v2-1/essentials/actions.md) using `computed.[propertyName]()`.

```javascript
component extends="cbwire.models.Component" {

    // Computed Properties
    computed = {
        "allTasks": function() {
            // return something here
        }
    };

    // Action
    function deleteTasks() {      

        if ( arrayLen( computed.allTasks() ) {
            taskService.deleteAll();
        }

    }
}
```

## Accessing From Templates

You can access Computed Properties in your [Template](#templates) using `args.computed.[computedProperty]()`.

```html
<cfoutput>
<div>
    <ul>
        <cfloop array="#args.computed.allTasks()#" index="task">
            <li>#task#</li>    
        </cfloop>
    </ul>
</div>
</cfoutput>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cbwire.ortusbooks.com/v2-1/essentials/computed-properties/computed-properties-proxied.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
