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

RFC: Integrate eth-block-tracker for subscribable queries #2

Open
danfinlay opened this issue Apr 20, 2017 · 3 comments
Open

RFC: Integrate eth-block-tracker for subscribable queries #2

danfinlay opened this issue Apr 20, 2017 · 3 comments

Comments

@danfinlay
Copy link

Feature Proposal

Description

What if ethjs queries returned promEvents, somewhat like [email protected] plans to have.

In addition to calling .then() on a result, you could subscribe to updates. Imagine:

token.balanceOf(my_address).on('latest', updateBalanceView)

Should be easier than ever with eth-block-tracker.

@SilentCicero
Copy link
Member

SilentCicero commented Apr 20, 2017

oooooo. We can do this. But I would make in it's own module, and have hooks for it in different modules.

@danfinlay
Copy link
Author

Yeah maybe it could be like ethjs-event-contract, and its initialization takes an ethjs-contract and an eth-block-tracker, and allows subscribing to updates on any property constant function of that contract, as well as maybe access to a synchronous property cache, of last-retrieved values?

@SilentCicero
Copy link
Member

Yes, that could work and would reduce bulk/module complexity on the main contract object.

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

2 participants