feat(core): provide a generic enhancer/runner extension factory #1
Labels
priority:low
May be addressed at any time
scope:core
@foscia/core
status:external
Depends on an external fix
type:feat
New feature
What problem is this solving
Currently, TypeScript generics have a design limitation which will block the capability to rewrite a generic function return type while providing its generic arguments. That's why a lot of enhancers/runners have dedicated "extension" properties and types, which allow us to have a correct defintion for action's method's typing for the enhancer/runner.
While the best way to do this is to have a generic method on actions, another simplier possiblity is to have a generic extension factory which will only take an enhancer/runner.
Proposed solution
Here is an example on the work I've already done on the question:
This solution is close to work, but currently it will only return an Action without any other custom methods.
Describe alternatives you've considered
No response
The text was updated successfully, but these errors were encountered: