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

Adding asynchronous features to harness #20

Open
4 tasks
hardingalexh opened this issue Sep 4, 2024 · 1 comment
Open
4 tasks

Adding asynchronous features to harness #20

hardingalexh opened this issue Sep 4, 2024 · 1 comment
Assignees

Comments

@hardingalexh
Copy link
Contributor

Most of the setter functions are not asynchronous. This is not desirable because we often have use cases for using asynchronous code (ie: fetch requests) within beforeSet/afterSet functions as well as loadData itself.

  • Make setFilter async
  • Make loadData async
  • Make setChartData async
  • Ensure that all of the above wait on their respective before/after set functions
@andykawabata
Copy link
Collaborator

After realizing that making certain function async would not allow us to await a subscription relative to the trigger we decided to go with a different approach. Alex specified:

what if HVB just ran setFilter, and harness itself had the check for synchronous and running of loadData? if so, we formalize the synchronous behavior instead of having that be a side effect of the component package. and if we do, we can put that check into the subscription block so that it explicitly runs after user-defined afterSet behaviors

we’d be altering the subscribeActions function in here: https://github.com/RTIInternational/harness-vue/blob/main/src/store/subscriptions.js
so that in before we would await runSubscriptions, and in after we would await runSubscriptions, then add a check that looks for setFilter with synchronous set to false and then await loadData

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