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

Enhance scenario trigger interface #31

Open
yuriyyakym opened this issue Nov 26, 2023 · 0 comments
Open

Enhance scenario trigger interface #31

yuriyyakym opened this issue Nov 26, 2023 · 0 comments
Labels
enhancement New feature or request idea
Milestone

Comments

@yuriyyakym
Copy link
Owner

yuriyyakym commented Nov 26, 2023

Right now the only way to trigger a scenario with multiple AwaiEvents's/promises is to have a trigger callback and use Promise.race, like so:

scenario(
  () => Promise.race([
    action1.events.invoked,
    delay(1000),
  ]),
  () => { /* ... */ }
);

It should also be possible to pass an array or AwaiEvents:

scenario(
  [action1.events.invoked, state1.events.changed],
  () => { /* ... */ }
);
@yuriyyakym yuriyyakym added this to the Base functionality milestone Nov 26, 2023
@yuriyyakym yuriyyakym self-assigned this Nov 26, 2023
@yuriyyakym yuriyyakym added enhancement New feature or request idea labels Nov 27, 2023
@yuriyyakym yuriyyakym removed their assignment Nov 27, 2023
@yuriyyakym yuriyyakym modified the milestones: Base functionality, Ideas Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request idea
Projects
None yet
Development

No branches or pull requests

1 participant