-
Notifications
You must be signed in to change notification settings - Fork 664
Updating And Improvement Typescript Infrastructure #393
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #393 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 15 15
=====================================
Hits 15 15Continue to review full report at Codecov.
|
|
Any idea when this pull request is expected to be merged ? I'm really looking forward using the typing in my typescript unit tests. In the meantime (if it can help others) I added this to my code so that I do not get typings error: function hasDependenciesProperty<S, R, C>(selector: OutputSelector<S, R, C>): selector is OutputSelector<S, R, C> & { dependencies: Function[] } {
return selector.hasOwnProperty('dependencies');
}
export function getDependencies<S, R, C>(selector: OutputSelector<S, R, C>): Function[] {
if (hasDependenciesProperty(selector)) {
return selector.dependencies;
}
return [];
} |
|
👎 Those types obviously won't work. Parametric selectors are never uniform. |
|
@anilanar what did you mean? Unirorm it is homogenios or geterogenios? Why will not this typings working? There is special typing test, that checks typings. If you have broken code, can you send code snippet to check it? |
|
Sorry I was hasty when I read the code, those types are pretty good. One problem for us though is that having a third parameter in a child selector still produces a selector whose third arg is |
|
Are you saying about this |
|
Yes, exactly. |
|
Ou, I can not say that it is good solution for this library maintainers, but I think it is not linked with main goal off this PR. I just wanted to add dependecies in typings but when I tried to do this I was surprised how difficult to do this. So, I tried to simplify typings maintaining. But almost an year has passed and there's no activities from maintainers. They could say that they don't like solution with typings generation, I can prepare PR with hargcoded dependencies in typings. But if we are speaking about any parameters, I left them as is, because removing of them is breaking changes. But i didn't want to make breking changes, i wanted to make some small improvement. If you want to suggest removing of this any parameters, you can make separete PR with realisation of this suggestion. But thanks for activity in this PR, may be it will attract attention of maintainers. |
|
@sgrishchenko If you publish a fork, I'd gladly use your typings. |
Feature scope:
"strict": truein tsconfig.json)createSelectoroverloadscompile:typescriptin package.json)tsc --noEmitMinor changes: