Developer Manual

Redux / State

The app’s state is split between the Redux store, and per component state when the state does not need to be shared throughout the app.

Redux actions are used to:

  • manage edited assets: the edited document as well as the underlying type definition and code
  • manage UI state: switch layouts, toggle block visibility, drag blocks and enter / exit full screen.
  • communicate with the preview iframe / between blocks

Redux store

The redux store contains:

  • the store defined in xrc-cms
  • an object named edit containing the specific Edit app store

The Edit app store is structured thus:

  doc: {} the edited asset's cloud doc,
  codeDoc: {} the edited asset's code doc,
  typeDef: {} the edited asset's TypeDefinition doc,
  logs: [] console logs generated by the preview iframe,
  layoutConfigs: {} available layouts,
  presetKey: current layout preset name,
  layout: {} current preset layout object