Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vendasta/core

Package Overview
Dependencies
Maintainers
1
Versions
772
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vendasta/core

Services for vendasta angular applications

  • 0.0.7
  • npm
  • Socket score

Version published
Weekly downloads
18
decreased by-37.93%
Maintainers
1
Weekly downloads
 
Created
Source

Market Service

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

Requirements

The Market Service interface:

export interface Market {
  name: string;
  id: string;
}


export interface MarketServiceInterface {
  getMarkets(): Observable<Market[]>;
}

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

import {MarketServiceInterface} from '@vendasta/core';

@Injectable()
export class MarketService implements MarketServiceInterface {
  …
  getMarkets(partnerId: string): Observable<Market[]> {
    // Implement how the project gets markets
  }
}

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

import { MarketServiceImpl } from './market.service';
import { MarketServiceInterfaceToken, MarketModule } from '@vendasta/core';
…
@NgModule({
  …
  imports: [MarketModule],
  providers: [
    {provide: MarketServiceInterfaceToken, useExisting: MarketServiceImpl}
  ],
})
  • Note: To be able to inject an interface, you will have to provide the InjectionToken and not the interface itself (MarketServiceInterfaceToken vs MarketServiceInterface).

FAQs

Package last updated on 20 Sep 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc