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 configuration/staus binding/subscription method #13

Open
myme opened this issue Jul 12, 2018 · 0 comments
Open

Add configuration/staus binding/subscription method #13

myme opened this issue Jul 12, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@myme
Copy link
Contributor

myme commented Jul 12, 2018

xconfiguration and xstatus trigger feedback on changes, but they are also non-transient and can be fetched at any time. A very nice convenience method would be to allow binding a callback to configs and statuses which is invoked with the initial value, as well as being called back on changes.

Possible names are .bind() or .subscribe(). "Subscribe" might be a better fit, as "bind" implies more of an end-to-end data binding between elements.

Requirements:

  • Feedback APIs must be changed to return a Promise which resolves on successful registration.
  • Add a "Subscribable" interface which is mixed into Config and Status.
  • Subscribable has a .subscribe() method which first registers feedback, then fetches the value.
  • To avoid races, the feedback registration promise must be resolved before the callback is invoked with the current value, from then on, the callback is invoked on all feedback.
  • Feedback which arrives before the fetched value is returned, should be queued to avoid data races.
@myme myme added the enhancement New feature or request label Jul 12, 2018
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

No branches or pull requests

1 participant