Tags

Tags allow you to reference things in Cerebral. They are based on template literal tags. They can be used by operators, connect and compute. Some of them can also be used with other Cerebral modules. The great thing about tags is their composability. For example:

import { state, props } from 'cerebral/tags'

state`items.${state`currentItemKey`}`

state`items.${props`itemKey`}`
  • state - Used in signals and connect to target state
  • module - Used in signals to target state of the module running the signal
  • props - Used in signals to target payload and in connect to target component props
  • signal - Used in signals and connect to target a signal
  • signals - Used in connect to target all the signals of the specified module
  • string - Used in signals to evaluate a composed string

Compatibility 

  • operators: state, module, props, signal and string
  • connect: state, props, signal and signals
  • compute: state and props