Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "util/stateManagement"

Index

Functions

Functions

Const useReaction

  • useReaction<T>(expression: function, effect: function, options?: IReactionOptions): void
  • A simple convenience hook that creates a reaction with provided expression, effect and options. Reaction will be created only once (will not be disposed/recreated between renders). Reaction will be automatically disposed when the component is unmounted. If this reaction creates other reactions, those reactions will NOT be disposed. In that case create a reaction manually inside a useEffect hook as described in mobx-react documentation .

    Type parameters

    • T: unknown

    Parameters

    • expression: function
        • (reactionObject: IReactionPublic): T
        • Parameters

          • reactionObject: IReactionPublic

          Returns T

    • effect: function
        • (expressionResult: T, reactionObject: IReactionPublic): void
        • Parameters

          • expressionResult: T
          • reactionObject: IReactionPublic

          Returns void

    • Optional options: IReactionOptions

    Returns void

Generated using TypeDoc