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
feat(types): Add ModelDefined type as syntactic sugar #12445
feat(types): Add ModelDefined type as syntactic sugar #12445
Conversation
Codecov Report
@@ Coverage Diff @@
## v6 #12445 +/- ##
==========================================
- Coverage 96.44% 96.42% -0.03%
==========================================
Files 95 95
Lines 9154 9154
==========================================
- Hits 8829 8827 -2
- Misses 325 327 +2
Continue to review full report at Codecov.
|
Please take care of that |
Is synchronized now. Also commented out the Notice about synchronization |
🎉 This PR is included in version 6.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request check-list
Please make sure to review and check all of these items:
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
The current way to define a module in a functional way with Typescript works like this:
However this approach is a bit much to write, and with the
ModelDefined
type it could be reduced to:It's just added syntactic sugar, that simplifies things.
Also there is no reference to
ModelCtor
nor a functional way with Typescript in the docs.So another change is, I've added an example for defining models in a functional way in Typescript.