Open JeffreytheCoder opened 4 months ago
Hey @JeffreytheCoder great work with the migration I would suggest you attach a Video to show case that the Features are working as expected with new changes.
Thanks @VipinDevelops! I saw you created a GitHubApi
instance for calling getBasicUserInfo
in #144 .
But in this way, everytime we need to call an API, we need to create a instance and fetch properties like access_token
and BaseHost
.
I'm thinking of creating a GitHubApi
singleton on app setup. On creation, the singleton will fetch and store the properties. All app actions can call APIs using the singleton. What do you think?
Hey @JeffreytheCoder Yesterday, @samad-yar-khan Also shared about this and suggested a new way to improve this with a nice reference,
Your approach is good, but let me first research the method Samad shared and then I can make a new PR that fixes this issue.
@JeffreytheCoder @VipinDevelops I was thinking along the same lines as @JeffreytheCoder. We should think about two things while approaching the design for this class
@samad-yar-khan Thanks for the insights! Like my comment above, I think having token & URL stored in a singleton solves the issue of fetching themevery time. Whenever the user updates token & URL in the settings, we update the singleton too. What do you think?
I agree with @samad-yar-khan. @JeffreytheCoder, can you please implement it that way in this PR? Then, Samad can review it, and we can move forward from there and also update the few places where this new class is being used.
Implemented the singleton approach and applied to all migrated methods in this PR and in #144.
Behavior same as before:
The singleton gets api host from environment and generates access token when initialized. We'll need to update these when user update settings / login / logout in another PR.
Issue(s)
Fixes a part of #143
Acceptance Criteria fulfillment
Completed 6 migration tasks related to issues GET APIs