Skip to content

Support API calls via backend #6

@yashsehgal

Description

@yashsehgal

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 call

These 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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions