Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IUseSignalProps<SENDER, ARGS>

Props for the UseSignal component

Type parameters

  • SENDER

  • ARGS

Hierarchy

  • IUseSignalProps

Index

Properties

children

children: (sender?: SENDER, args?: ARGS) => React.ReactNode

Function mapping the last signal value or inital values to an element to render.

Note: returns React.ReactNode as per https://github.com/sw-yx/react-typescript-cheatsheet#higher-order-componentsrender-props

Type declaration

    • (sender?: SENDER, args?: ARGS): React.ReactNode
    • Parameters

      • Optional sender: SENDER
      • Optional args: ARGS

      Returns React.ReactNode

Optional initialArgs

initialArgs: ARGS

Initial value to use for the args, used before the signal emits a value. If not provided, initial args will be undefined.

Optional initialSender

initialSender: SENDER

Initial value to use for the sender, used before the signal emits a value. If not provided, initial sender will be undefined

Optional shouldUpdate

shouldUpdate: (sender: SENDER, args: ARGS) => boolean

Given the last signal value, should return whether to update the state or not.

The default unconditionally returns true, so you only have to override if you want to skip some updates.

Type declaration

    • (sender: SENDER, args: ARGS): boolean
    • Parameters

      • sender: SENDER
      • args: ARGS

      Returns boolean

signal

signal: ISignal<SENDER, ARGS>

Phosphor signal to connect to.

Generated using TypeDoc