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
Factor out confirm
, placeholder
, focus_on_load
and dispatch_action_config
properties
#1550
Conversation
…to own interfaces that other elements extend from. Factor out `dispatch_action_config` property into own extendable interface.
placeholder?: PlainTextElement; | ||
} | ||
|
||
export interface Dispatchable { |
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.
Right now only one element uses this interface, but if/when we merge #1549, then the new input elements like URL, email and number inputs will also use this interface.
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.
Great work 💯 this reminds me of a decorator pattern?
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 like this direction, and thank you for additional jsdoc to help document things. Left a minor comment about naming.
packages/types/src/index.ts
Outdated
dispatch_action_config?: DispatchActionConfig; | ||
} | ||
|
||
export interface UsersSelect extends Action, Confirmable, Focusable, Placeholderable { |
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.
:chefs-kiss:
Co-authored-by: Sarah Jiang <sarahjiang@slack-corp.com>
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.
<3 Love it! Only found a minor improvement suggestion.
Co-authored-by: Michael Brooks <mbrooks@slack-corp.com>
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.
These documentation hints are wonderful, particularly when @see
comes into play! I'm a huge fan 👏
The idea behind this PR is to have a set of interfaces that other Block Kit elements can extend from easily.
This PR also starts adding some of the documentation hints from api.slack.com as JSDoc comments.
It is a small refactor, but it is especially helpful when documenting properties, as then they can be documented in one place but used in many places.
Let me know what you think! Like/dislike/don't care?