Closed ngankhanh98 closed 3 years ago
Hi Khánh,
Yes, and with the first solution, I believe I need to install a new state or else, modify course state
to store my-course
from called API. Then, when I create my course, 2 sources of state need to be updated: all-course and my-course. Part of me thinks this way is antithesis to Single source of truth priciple.
I think I will follow your 2nd direction, to efficiently use the power of Akita query. Thank you sir!!!
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current situation: Currently, we have 2 big modules:
pages
andauth
, each has their own Akita's state:Expected behavior: In route:
/attend/my-courses
, I expect to see courses created by me. To doing so,auth.userId
orauth.username
should be retrieve; andcourse
should returns to all course, then querying them bothSolution suggests:
__ Currently, I'm doging my 2nd approach. The above drawbacks are what I faced or am facing with. Besides, I would like to know if these 2 solutions are anti-pattern (because I have no idea). @dohoangdinhtien