firestore-base-service

1.2.1 • Public • Published

Firebase Firestore Base Service

Description

Base service and interface to manage the read/write to firebase firestore realtime database as item based

Installation

Add package to your project

npm i firestore-base-service

Extends your item interface from our base to preserve id property

import { ItemInterface } from 'firestore-base-service';

export interface YourItemInterface extends ItemInterface {
   // Your properties
}

Extends your item service from our base to get the functionally and add the item type string to manage on database

import { BaseService } from 'firestore-base-service';

@Injectable({
    providedIn: 'root'
})
export abstract class YourItemService<YourItemInterface> extends  BaseService {
    protected abstract readonly itemType: string = 'yourItem';  // better use an Enum with all items

    // your methods here
}

Package Sidebar

Install

npm i firestore-base-service

Weekly Downloads

0

Version

1.2.1

License

Apache2

Unpacked Size

19.4 kB

Total Files

14

Last publish

Collaborators

  • danilozano