🗡️
ConanJs
  • What is ConanJs?
  • Why ConanJs...
    • ... if coming from Redux
    • ... if using vanilla React
    • ... if learning React
    • ... if not using React
  • How to install/use ConanJs
  • About us / Github / Contact us
  • Demos
    • Demo Gallery
    • Conan State Demos
      • Hello World
      • Todos
        • Todos - Basic
        • Todos - Async
        • Todos - Optimistic
      • Github issues viewer
    • Conan Flow Demos
      • Authentication
  • CONAN DATA
    • General Concepts
    • Conan State
      • Actions & Reducers
        • Reducers
        • Actions
      • Creating State
      • Observing State
        • Live rendering
        • Connecting
      • Composing State
      • Scaling State
      • Orchestrating State
      • Life cycle
        • Async handling
        • Introspection
      • Testing state
    • Conan Flow
      • Creating Flows
      • Serialising Flows
      • Observing Flows
  • CONAN Runtime
  • Dependency Injection
    • General Concepts
    • Creating the Context
    • Using the Context
  • ASAPs
  • Logging
  • API
    • Main Classes
      • Conan
        • StateDef
      • ConanState
      • ConanFlow
        • UserFlowDef
        • UserStatusDef
        • Status
    • Conan State Classes
      • Thread
      • ConnectedState
      • MonitorInfo
      • MetaInfo
    • Dependency Injection
      • DiContextFactory
    • ASAPS
      • Asaps
      • Asap
Powered by GitBook
On this page
  • Introduction
  • Global
  • Local
  • Context
  • Runtime
  • Component

Was this helpful?

  1. CONAN DATA
  2. Conan State

Scaling State

PreviousComposing StateNextOrchestrating State

Last updated 4 years ago

Was this helpful?

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

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, , this means that you can use the context state

Runtime

you can have state that you use inlined in your JS

Component

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.

You can leverage scoping locally the state at the top of your component renderer and have the renderers down the line leverage the

application context from the DI
application context (DI)
By composition
is stored in the context
context state