Skip to content

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

Merged
basarat merged 2 commits into
DefinitelyTyped:masterfrom
use-strict:master
Jul 29, 2015
Merged

basarat merged 2 commits into
DefinitelyTyped:masterfrom
use-strict:master

Conversation

@use-strict

Copy link
Copy Markdown
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

vvakame commented Jul 28, 2015

Copy link
Copy Markdown
Member

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

@basarat

basarat commented Jul 29, 2015

Copy link
Copy Markdown
Member

👍

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.

3 participants