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 action delegation #113

Open
jnicklas opened this issue Oct 28, 2021 · 0 comments
Open

Add action delegation #113

jnicklas opened this issue Oct 28, 2021 · 0 comments

Comments

@jnicklas
Copy link
Collaborator

jnicklas commented Oct 28, 2021

In #90 we added filter delegation, in #102 we proposed locator delegation. The final piece of the puzzle is action delegation! Action delegation kind of already exists today:

HTML.extend('calendar')
  .selector('.calendar')
  .actions({
    async open(interactor) {
      await interactor.find(Button('Open').click());
    }
  });

The idea here is to align this with the filter syntax, to achieve something like the following:

HTML.extend('calendar')
  .selector('.calendar')
  .actions({
    open: Button('Open').click()
  });

Which would have identical behaviour.

The problem is that actually implementing this is probably very difficult, and will require some deep rethinking of interactions to make this possible.

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

1 participant