You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently watch accepts a single optional argument in 3rd position to bind an argument for the watcher. If that argument is not provided, the watcher is still called with an undefined argument, which can trip up interface guards that do not expect it.
Furthermore watchPromise which is the ancestor of watch accepted multiple positional arguments after the watcher, creating a migration footgun.
To Reproduce
Expected behavior
Accept multiple positional arguments and respect arity.
Platform Environment
master
Additional context
Screenshots
The text was updated successfully, but these errors were encountered:
closes: #9555
## Description
This PR updates the internal watcher exo to handle an args list, and updates the `watch` tool to check the arity and realize if a 3rd argument has been provided or not. It does not currently accept a regular rest argument like `watchPromise` does.
### Security Considerations
None
### Scaling Considerations
None
### Documentation Considerations
Updated type definition
### Testing Considerations
I didn't find any unit test coverage for this but some integration tests have shape on the watcher checking the arity.
### Upgrade Considerations
Need to settle the internal handling of arguments before we commit to them in state.
Describe the bug
Currently watch accepts a single optional argument in 3rd position to bind an argument for the watcher. If that argument is not provided, the watcher is still called with an
undefined
argument, which can trip up interface guards that do not expect it.Furthermore
watchPromise
which is the ancestor ofwatch
accepted multiple positional arguments after the watcher, creating a migration footgun.To Reproduce
Expected behavior
Accept multiple positional arguments and respect arity.
Platform Environment
master
Additional context
Screenshots
The text was updated successfully, but these errors were encountered: