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 ability for frontend to trigger events in the script #119

Closed
sohkai opened this issue Jun 5, 2018 · 2 comments · Fixed by #361
Closed

Add ability for frontend to trigger events in the script #119

sohkai opened this issue Jun 5, 2018 · 2 comments · Fixed by #361
Labels
enhancement New feature or request

Comments

@sohkai
Copy link
Contributor

sohkai commented Jun 5, 2018

It'd be great if there was a way for the frontend to send arbitrary events to the script, and define logic in the script to handle it.

It could look like app.trigger('<event name>', <event params...>) from the frontend, and @aragon/client's app.store() could receive these as-is.

See #313 (comment) for an description of how this could potentially be done.

@2color
Copy link
Contributor

2color commented Apr 4, 2019

That's an interesting idea. Can you give an example of a use-case?

@sohkai
Copy link
Contributor Author

sohkai commented Apr 4, 2019

A few come to mind:

  • Fetching more data (if, in the future, reducing all of the state takes too long)
  • Triggering an external API call that is better handled as part of the webworker
  • Adding data that the script wouldn't otherwise know about from pure contract events (e.g. adding tracked tokens, Finance: add tracked token (without manual deposit) client#624)
  • Optimistic UI for actions (multiple ways to do this, but "triggering" an "optimistic" event in the script could be one way)

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

Successfully merging a pull request may close this issue.

2 participants