-
Notifications
You must be signed in to change notification settings - Fork 13
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
Object selection models and plugins #21
Conversation
components/js/SlickGrid.ts
Outdated
for (let plugin of this.plugins) { | ||
this.registerPlugin(plugin); | ||
if (typeof plugin === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this if check anymore, correct? registerPlugin
accepts the plugin whether it's a string or a plugin object, so you can get rid of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its a bug in typescript, if I don't add a type check if complains string | object
not assignable to string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I could fix it by not overloading the function and instead just having the input as string | object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like its a bug that they couldn't find a good way to fix, so they said just workaround it via my solution about just using a union type instead of an overload microsoft/TypeScript#1805
Adds the ability to specific selection models and plugins via the objects themselves rather than through names and assuming they will be attached to the global Slick object.
Also adds mapping files for easier debugging.