🗡️
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
  • Vanilla state management
  • Old school: setState + callback props
  • Cool kids: hooks + context
  • More Demos
  • And more...

Was this helpful?

  1. Why ConanJs...

... if using vanilla React

Previous... if coming from ReduxNext... if learning React

Last updated 4 years ago

Was this helpful?

If you use Vanilla react, you are likely to have dealt with state with one or both of two main vanilla approaches.

Vanilla state management

Old school: setState + callback props

This pattern makes sense to use when what you have to deal with is small and self contained.

The problem with this is that it doesn't scale well, if your original component uses this approach and over time it grows, you are likely to find yourself passing way too many callbacks, and to also pass them too deep in your component hierarchy.

A solution to this would be to put your state in Redux, but then you would have to deal with all the boilerplate, and you will loose the fact that this state was encapsulated in the component.

We would recommend having a look at this demo to see how to manage local state with ConanJs

Cool kids: hooks + context

You might be doing React Hooks and using the React Context API as the container of your state.

Basically, you can conceptually use the same approach, and yet again, make no compromises, you can still decide to use this for some state, but then, for some other state, to scope it globally because it is more sensible.

With Conan State we made an effort to avoid developers making compromises.

Usually you would pick a pattern/framework or two to manage your state, and this would constraint you to a certain scope, or to a way of updating/observing your state.

More Demos

This demos will provide you with real world scenarios to use ConanJs

And more...

If this was not enough, we have some more features included.

With ConanJs, you don't have to compromise, Conan State is designed to let you choose where to , and makes updating the state through its out even simpler than if you were to do it with setState + callback props.

This is a very powerful pattern of which we are very fond. That is why ConanJs lets you work and it has its own built-in out of the box.

With ConanJs, you pick, how to , how to , how to , and .

Hello World
create your state
scope it
observe it
how to update it
Todos
Github issues viewer
Conan Flow
Dependency Injection
ASAPs
Logging
scope your state
with the Context
Old school cool!
hooks
of the box actions