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

add event emitter option for client to support messages composer #76

Open
pyramation opened this issue Nov 2, 2022 · 0 comments
Open

Comments

@pyramation
Copy link
Collaborator

pyramation commented Nov 2, 2022

Some users may want to control state a bit more than what client.execute provides, which is the default way the client operates. For example, client.execute current does this:

  1. composes the messages
  2. signs the message
  3. broadcasts the message

The issue is that, during #2, the user may be signing via keplr, and technically there is more state involved, if perhaps you wanted to display a spinning loader to the user interfaces.

Example of separating these out using the current message composer option:
https://github.com/EquilibriumEtf/frontend/blob/main/contexts/tx.tsx
https://gist.github.com/pyramation/0ce63b6026cc15a68c46454af2c879de

However, this implementation is conflating UI and transaction state. I think a solid implementation could involve adding an option to the client option that enables an emitter, or some state object that can emit state to objects outside of the class instance during a transaction, potentially messages/state like is_signing, is_broadcasting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant