Function useSubjectValue

A function that retrieves and sets the value of a subject.

  • Type Parameters

    • Data = any

      The type of data stored in the subject.

    Parameters

    • target: TSubject<Data>

      The subject to subscribe to.

    • Optionalvalue: Data | (() => Data)

      The initial value for the subject, if not provided the subject's initial value will be used.

    Returns Data

    • The current value of the subject.