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 to help you scope your state.

In summary, the state of your state can be:

Global

You can have global state, mainly you can either import it as a normal object or by leveraging our application context (DI)

Local

You can have local state to your component by just declaring it and using it locally to your component

Context

The moment you connect state, is stored in the context, this means that you can use the context state

Runtime

By composition 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

Last updated

Was this helpful?