Skip to content

[Proposal] Framework Specific APIs #11

@songkeys

Description

@songkeys

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions