I need advice, i need data from store in service (my service use Angulartics to send data to Google Analytics). I stored all needed data as object in store, what is better:
- Subscribe to store in my service, which send data each time to analytics.
- Inject store to each component, get data – send to service, then unsubscribe?
Also, i dispatching action when getting information in service. How i can create store field listener ? (get the data when this field will not be undefined)