Function useSubject

Creates and returns a subject that can be subscribed to.

  • Type Parameters

    • Data = any

      The data type of the subject.

    Parameters

    • Optionaltarget: null | TSubject<Data>

      An optional target subject to subscribe to.

    Returns Subject<Data>

    • The created subject.