This package has been deprecated

Author message:

Moved to @vendasta/core

@vendasta/partner-service
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Partner Service

This provides a service for other components to use to retrieve partner information.

Requirements

The Partner Service interface:

export interface PartnerServiceInterface {
  getPartnerId(): Observable<string>;
}

To implement the interface make a new service that implements the interface:


import {PartnerServiceInterface} from '@vendasta/partner-service';

@Injectable()
export class PartnerService implements PartnerServiceInterface {
  
  getPartnerId(): Observable<string> {
    // Implement how the project determines which partner id the current context is in
  }
}

Next you will need to provide your service as that interface (generally in app.module.ts)

import { PartnerService } from './partner.service';
import { PartnerServiceInterfaceToken } from '@vendasta/partner-service';

@NgModule({
  
  providers: [
    PartnerService, {provide: PartnerServiceInterfaceToken, useExisting: PartnerService}
  ],
})
  • Note: To be able to inject an interface, you will have to provide the InjectionToken and not the interface itself (PartnerServiceInterfaceToken vs PartnerServiceInterface).

/@vendasta/partner-service/

    Package Sidebar

    Install

    npm i @vendasta/partner-service

    Weekly Downloads

    0

    Version

    1.0.2

    License

    ISC

    Last publish

    Collaborators

    • vendasta