@mars-man/models
v1.3.15
Published
for data models, forms and repository pattern
Downloads
6
Readme
Description
Data Model / Form / Repository Pattern
Table of Contents
Development
System Requirements
- Dependencies:
- node: >14.15
- npm: >6.14
Commands
# installation
npm i
# tests
# run full test suite
`jest`
# run specific test suite
`jest forms.test.ts`
# run specific test
`jest model.test.ts -t "async true"`
# build
npm run build
# publish
npm publish
Form
The goal of the form is
- to use the same DTO object the server expects to validate the input
- this requires formatting the data to/from frontend and backend data structure
- to abstract
Repo
Repos are the data sources, implemented with the repository pattern.
They can effectively be any data source (GraphQL, Firestore, Clod Storage...) but as of right now only APIRepo is implemented
Models
Models orchestrate the forms and repos