StateManagerVisibility
Overview
Type: enum
This only concerns React for the time being.
This is used to control whether state values will be exposed in the React Developer Tools but only applies to StateManager
and AsyncStateManager
.
This can be specified in the options
parameter in the constructor of the State Manager:
import { StateManager, StateManagerVisibility } from 'cotton-box'
const ExampleState = new StateManager('Hello, world!', {
visibility: StateManagerVisibility.HIDDEN,
})
Values
Key | Value | Description |
---|---|---|
ENVIRONMENT | 0 | State values will be exposed in non-production environments, but hidden in production environment. |
EXPOSED | 1 | State values will be always exposed regardless of the environment. |
HIDDEN | 2 | State values will be always hidden regardless of the environment. |
The screenshots below show how State Managers with different visibility
values appear in the React Developer Tools.
With
StateManagerVisibility.HIDDEN
:With
StateManagerVisibility.EXPOSED
: