# Scaling State

### Introduction

ConanState are normal plain javascript objects. this means that when you decide the scope of your state, you can do it as you would do for any normal object.

On top of that, you can leverage our [application context from the DI](/dependency-injection.md) to help you scope your state.

In summary, the state of your state can be:

### **Global**&#x20;

You can have global state, mainly you can either import it as a normal object or by leveraging our [application context (DI) ](/dependency-injection.md)

### **Local**

You can have local state to your component by just declaring it and using it locally to your component&#x20;

### **Context**&#x20;

The moment you connect state, [is stored in the context](/data/conan-state/subscribing-state.md#conanstate-context), this means that you can use the context state&#x20;

### **Runtime**&#x20;

[By composition](/data/conan-state/pipes-composing-state.md) you can have state that you use inlined in your JS

### **Component**

You can leverage scoping locally the state at the top of your component renderer and have the renderers down the line leverage the [context state](/data/conan-state/subscribing-state.md#conanstate-context)

{% hint style="success" %}
There seems to be a trend where you would have to pick not only what tool you would prefer to use to manage your state, but also, that would constraint you on how to scope the state then.

The biggest use case for this, are the libraries that push for state to be always global.

We think that is a mistake, any modern web application has state and being able to choose the adequate scope for it is very important.
{% endhint %}

![](/files/-MBjCOijsAA_mwUi6aPV)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.conanjs.io/data/conan-state/scoping-state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
