Socket
Socket
Sign inDemoInstall

@worldsibu/convector-core-model

Package Overview
Dependencies
13
Maintainers
1
Versions
187
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @worldsibu/convector-core-model

Convector Model base class


Version published
Weekly downloads
152
decreased by-25.85%
Maintainers
1
Install size
1.83 MB
Created
Weekly downloads
 

Readme

Source

Convector Model

This module contains the base model to be used as a base for any other model.

Usage

The children classes can be used in 1 of 3 ways:

As an model query

class MyModel extends ConvectorModel<MyModel> { ... }

const model = new MyModel(id);
model.fetch()
  .then(onModelFound)
  .catch(onModelNotFound);

As a param constructor and validator

class MyModel extends ConvectorModel<MyModel> { /* ... */ }

@Controller('my-controller')
class MyController {
  @Invokable()
  public async myMethod(
    @Param(MyModel)
    myModel: MyModel
  ) {
    myModel.save();
  }
}

As a container to start filling the model

class MyModel extends ConvectorModel<MyModel> { /* ... */ }

const myModel = new MyModel();
myModel.name = 'name';
myModel.info = 'info';
/* ... */
myModel.save();

Keywords

FAQs

Last updated on 03 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc