-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Planning to work on a backend supported set of methods similar to all the ones we have inside useGitHub() hook. Keeping a hook for all the methods will be a handy thing in frontend, but for server-side modules and SSR, it will not work in such cases.
As a solution, we should have a class-based implementation supported as well. Which can have a DX something like,
const gh = utiliseGitHubRestAPI();
const userInfo = gh.getUserInfo(); // returns the user info on function call
const repos = gh.getRepositories(); // returns the user repositories on function callThese methods will perform the same actions as the functions inside useGitHub(). Also, these methods will be shared across both hooks and classes, considering the better coding patterns.