Name for coming "extensions"
See original GitHub issuePR #1036 happened. Now you can class MySwal extends Swal {
.
I’m in the process of extracting features from the base Swal
into layers - functions that return a class that extends the given class. We need a name for these “extensions”/“HOCs”/“decorators”/“enhancers”/“things”.
Internally they’re named “extensions” right now, but we should agree on the term to be used consistently in documentation as addon/plugin modules (like sweetalert2-react-content) come into play.
The pattern I’m using is literally the same pattern as Higher Order Components (HOCs) in React. Too bad the name doesn’t really make sense in this context, since Swal doesn’t have “Components”.
I’ve also seen these things referred to as “enhancers”, which is where I would place my vote right now… e.g. sweetalert2-enhancer-global-state
or sweetalert2-enhancer-form-builder
.
There was a bit of prior discussion here: https://github.com/sweetalert2/sweetalert2-react-content/pull/14
Please vote
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
enhancer
Alright, perfect!