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

refactor(entity): update types to interfaces #1370

Merged
merged 2 commits into from
Oct 17, 2018
Merged

refactor(entity): update types to interfaces #1370

merged 2 commits into from
Oct 17, 2018

Conversation

alex-okrushko
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Entities are using export type a lot. While they should work similar to interface, the latter is a preferred choice.
Moreover, tsickle tool has an issue type-annotating abstract classes that implement type at the moment: angular/tsickle#912

What is the new behavior?

The behavoir is unchanged, except it's more correct.

Does this PR introduce a breaking change?

[ ] Yes
[ x] No

Other information

(a: T, b: T): string;
};
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think even simpler is to write this:

type ComparerStr = (a: T, b: T) => string;

Here and below for the other function types.

(tsickle chokes on the old code, but I think the new code won't help there anyway, so you might as well write it in the simplest format, which tsickle also won't choke on.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It takes new code, I verified it. But, yeah, for function types it looks even simpler with type

@alex-okrushko alex-okrushko changed the title update types to interfaces refactor(entity): update types to interfaces Oct 16, 2018
@brandonroberts brandonroberts merged commit 226566f into ngrx:master Oct 17, 2018
@alex-okrushko alex-okrushko deleted the ts29 branch October 30, 2019 03:02
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