0.1.0 • Published 5 years ago
loopback-component-cascade v0.1.0
loopback-component-cascade
Using this simple extension you can cascade models create, update, delete in repository level.
Installation
npm i --save loopback-component-cascade
Usage
Cascade Repository Mixin
Change your repository parent class from DefaultCrudRepository
to CascadeRepositoryMixin()()
Example
Change your repository from:
export class UserRepository extends DefaultCrudRepository<
User,
typeof User.prototype.id,
UserRelations
> {
// ...
}
To:
import { CascadeRepositoryMixin } from "loopback-component-cascade";
export class UserRepository extends CascadeRepositoryMixin<
User,
string,
UserRelations
>()() {
// ...
}
Contributions
License
This project is licensed under the MIT license.
Copyright (c) KoLiBer (koliberr136a1@gmail.com)
0.1.0
5 years ago