Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Framework Specific APIs #11

Open
Songkeys opened this issue Mar 13, 2023 · 0 comments
Open

[Proposal] Framework Specific APIs #11

Songkeys opened this issue Mar 13, 2023 · 0 comments
Assignees
Labels
proposal Proposal

Comments

@Songkeys
Copy link
Member

Currently, the SDK API is framework-agnostic. Most of our applications are written in React, and developers are wrapping the API with hooks, such as:

// Examples of using react-query to wrap the API.

// Write
function useCreateCharacter(args) {
   return useMutation(() => contract.createCharacter(args))
}

// Read
function useCharacter(args) {
   return useQuery(() => indexer.getCharacter(args))
}

I am considering integrating this part into the SDK or creating a separate SDK to make development easier. For example:

  • @crossbell/js - the core logic, which can be used in vanilla JS code
  • @crossbell/react - the React version of the API (using hooks)
  • @crossbell/vue - the Vue version of the API (using composition APIs)
  • ...

Let me know what you think.

@Songkeys Songkeys added proposal Proposal v1 labels Mar 13, 2023
@Songkeys Songkeys added this to the 1.0 milestone Mar 13, 2023
@sxzz sxzz self-assigned this Apr 18, 2023
@sxzz sxzz removed this from the 1.0 milestone May 12, 2023
@sxzz sxzz removed the v1 label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal
Projects
None yet
Development

No branches or pull requests

2 participants