1.1.0-rc.1 • Published 4 years ago

@witty-services/repository-core v1.1.0-rc.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Repository Core

Build Status Coverage Status npm version NPM GitHub repo size GitHub last commit GitHub issues GitHub top language

This Typescript library allow you to define multiple repositories base on multiple decorated models.

Use this abstract library to make your own driver and use your differents repositories to retrieve data from your data source.

How to install

To install the library run :

npm i @witty-services/repository-core

How to run Unit Tests

To run unit tests and generate coverage, run :

npm run test

How to make a driver

This extract of code is an example of how to implements a driver repository.

import {AbstractRepository, Denormalizer, Normalizer} from '@witty-services/repository-core';

export abstract class MyDriverRepository<T, K = string, P = null> extends AbstractRepository<T, K, P> {
  
  public constructor(denormalizer: Denormalizer<T>, normalizer: Normalizer<T>) {
    super(denormalizer, normalizer);
    
    // ...
  }
  // implements all functions
}

Use your driver

This extract of code is an example of how to use your driver.

import {Repository} from '@witty-services/repository-core';
import {MyDriverRepository} from '...';
import {MyModel} from './my-model.model.ts';

export interface MyModelRepositoryParams {
  // ...
}

@Repostiory({

})
export class MyModelRepository extends MyDriverRepository<MyModel, string, MyModelRepositoryParams> { 
}
1.1.0-rc.1

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.1-rc.5

4 years ago

1.0.1-rc.4

4 years ago

1.0.1-rc.3

4 years ago

1.0.1-rc.1

4 years ago

1.0.1-rc.2

4 years ago

1.0.0

4 years ago