api.jquery.com
api.jquery.com copied to clipboard
Ajax example on when docs will fail with git build / 3.0
https://api.jquery.com/jquery.when/
The first example resolves with multiple arguments which will fail on the git build and in upcoming 3.0 release because it uses then which no longer allows multiple args and will resolve with an array now in this case.
It's also a bad example as it lack error handling
I think we should keep the example because people might rely on it and maintainers of projects using our previous versions might want to understand the pattern. My proposal is to add a fail()
call to the existing example and add a change in branch v3 with a single argument. We should also add an explanation of what is changed.
The only reason I'd want to keep it is to explain that people should not do it. That's fine though. Any call like $.when( something-that-is-always-a-Deferred )
doesn't need $.when
in the first place so we can explain that.