F

Fox Root • 490 Points
Goal Maker

Q. You need to fetch products when page loads automatically. What is the best approach?

  • (A) Call API inside constructor
  • (B) Dispatch LoadProducts action in ngOnInit
  • (C) Call reducer
  • (D) Use selector first
  • Correct Answer - Option(B)
  • Views: 1
  • Filed under category NgRx Store
  • Hashtags:

Explanation by: Fox Root
Component should dispatch action when it initializes to trigger effect and API call.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.