Try to search your question here, if you can't find : Ask Any Question Now ?

ngrx subscribe in service or pass data from component?

HomeCategory: stackoverflowngrx subscribe in service or pass data from component?
Avatarbhawya asked 4 months ago

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:

  1. Subscribe to store in my service, which send data each time to analytics.
  2. 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)

1 Answers
Best Answer
AvatarAmit answered 4 months ago
Your Answer

10 + 12 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com