Is something wrong on using a BehaviorSubject in an InjectionToken?

Discussão em 'Angular' iniciado por Ander2, Janeiro 30, 2025.

  1. Ander2

    Ander2 Guest

    I want to use a BehaviorSuject in an InjectionToken as the injected value may change and I want to subscribe to those changes.

    I've been looking around and I haven't seen any example or usage as I describe so, I'm not sure if injecting an Observable instead of a value is a good practice.

    Can anyone help me with these doubts?

    P.D.: The use case is to provide a Timezone, which most of the time will be a value which won't change, but the user can modify it and I want to update the injected value.

    Continue reading...

Compartilhe esta Página