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

ActionHandler returning InteractionInput always #302

Closed
danielpeintner opened this issue Feb 9, 2021 · 6 comments
Closed

ActionHandler returning InteractionInput always #302

danielpeintner opened this issue Feb 9, 2021 · 6 comments

Comments

@danielpeintner
Copy link
Contributor

PropertyReadHandler and ActionHandler are the same when it comes to the return value (returning Promise<InteractionInput>).

callback PropertyReadHandler = Promise<InteractionInput>(
        optional InteractionOptions options = null);

callback ActionHandler = Promise<InteractionInput>(
        InteractionOutput params,
        optional InteractionOptions options = null);

I wonder whether this is correct given propertyRead always returns a value and actions do not always return anything.
Shouldn't the return statement for ActionHandler be as follows?
Promise<undefined | InteractionInput>

@relu91
Copy link
Member

relu91 commented Feb 9, 2021

Good point actually. +1 from my side

@zolkis
Copy link
Contributor

zolkis commented Feb 22, 2021

We don't need it, since an object can be null and undefined. Describe in prose that it can be undefined.

@danielpeintner
Copy link
Contributor Author

Scripting Call 2021-02-22

@relu91
Copy link
Member

relu91 commented Mar 4, 2021

BTW the TS part was addressed in this PR: #307

@danielpeintner
Copy link
Contributor Author

I think we can close the issue, right?

  • WebIDL is clear that it can be null
  • TS was fixed

@danielpeintner
Copy link
Contributor Author

Scripting Call 2021-03-08, Agreed to close

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

3 participants