Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

TypeScript 2.2 Object and Intersection Types #118

Closed
matt-gadd opened this issue Jan 24, 2017 · 2 comments
Closed

TypeScript 2.2 Object and Intersection Types #118

matt-gadd opened this issue Jan 24, 2017 · 2 comments
Assignees
Milestone

Comments

@matt-gadd
Copy link

TypeScript 2.2 will have Object and Intersection types, microsoft/TypeScript#13604 which should drastically improve our inference through mixins and this.

We should look to see what improvements this can bring in terms of typing.

The code for this is in master so available under typescript@next

@maier49
Copy link
Contributor

maier49 commented Jan 26, 2017

From what I've gathered, I'm not sure this can be directly leveraged to improve typing in compose. Having classes and interface be able to derive from objects can be handy for certain mixin patterns, but I'm not seeing a way to fit it into compose. The main benefit for compose I can see from these changes is the fact that the this type of an intersection is now the intersection but this is more of an indirect benefit to users of the library. For example, a previous iteration of the stores API had something like this

interface QueryMixin {
  query(query: Query): this;
}

Types like this would work a lot better now because QueryMixin & Store & ... would properly return itself from a query.

@dylans dylans modified the milestones: 2017.01, 2017.02 Jan 31, 2017
@agubler
Copy link
Member

agubler commented Feb 15, 2017

@matt-gadd I think we can close this now after the move to TS2.2?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants