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

angularjs/angular.d.ts - Type safety for $watch and $watchCollection #5101

Merged
merged 2 commits into from
Jul 29, 2015

Conversation

use-strict
Copy link
Contributor

Added generic constraint to watched values, replacing "any". Using "any" looses type safety. The type should be inferred from the return type of the watching function, or given explicitly when using a watch expression. TypeScript defaults to "{}" for an unspecified "T". This may be a breaking change, because of more restrictive type checking.

Added generic constraint to watched values, replacing "any". Using "any" looses type safety. The type should be inferred from the return type of the watching function, or given explicitly when using a watch expression.
@vvakame
Copy link
Member

vvakame commented Jul 28, 2015

@diegovilar @basarat could you review this PR?
LGTM... maybe.

@basarat
Copy link
Member

basarat commented Jul 29, 2015

👍

basarat added a commit that referenced this pull request Jul 29, 2015
angularjs/angular.d.ts - Type safety for $watch and $watchCollection
@basarat basarat merged commit 855569d into DefinitelyTyped:master Jul 29, 2015
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.

None yet

3 participants