Function useBehaviorSubject

Initializes a new BehaviorSubject with optional initial data value.

  • Type Parameters

    • Data = any

      The type of data stored in the BehaviorSubject.

    Parameters

    • Optionaldata: null | Data = null

      The initial value of the BehaviorSubject. Defaults to null.

    Returns BehaviorSubject<Data>

    The newly created BehaviorSubject instance.