Skip to content

Improve validation of $.sync options binding#551

Merged
sindresorhus merged 1 commit intomainfrom
sync-opts
Mar 14, 2023
Merged

Improve validation of $.sync options binding#551
sindresorhus merged 1 commit intomainfrom
sync-opts

Conversation

@ehmicky
Copy link
Copy Markdown
Collaborator

@ehmicky ehmicky commented Mar 13, 2023

To bind options with the synchronous $ API, one must do:

$(options).sync`command`

However, users are likely to do the following instead:

$.sync(options)`command`

We could fix this either:

  • By supporting that second syntax.
  • By making it fail with a better error message.

This PR implements the second solution. However, I am happy to implement the first solution if you'd prefer it instead, just let me know!

Loading
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

Successfully merging this pull request may close these issues.

3 participants