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

0.10.11 • Public • Published

Data Services

npm

In order to communicate with external data sources, the framework will provide a single interface to interact with any external data source called a data service.

The responsibility of each data service implementation is to act as the interface for interacting with data coming from a specific data source.

Additional documentation can be found here

API

export interface DataServiceConfig {
  [key: string]: any;
}

export interface Payload {
  [key: string]: any;
}

export type ResourceKind = string;
export type ResourceId = string;

export interface URI {
  resource: ResourceKind;
  id: ResourceId;
}

export interface DataService<T = any> {
  get(target: URI, config: DataServiceConfig): Promise<T>;
  post(target: URI, payload: Payload, config: DataServiceConfig): Promise<any>;
  put(target: URI, payload: Payload, config: DataServiceConfig): Promise<any>;
  delete(target: URI, config: DataServiceConfig): Promise<any>;
}

Usage

Currently these are the data service implementations we provide and will maintain. More data services to come.

Readme

Keywords

none

Package Sidebar

Install

npm i @bfwk/data-service

Weekly Downloads

1

Version

0.10.11

License

MIT

Unpacked Size

29.4 kB

Total Files

17

Last publish

Collaborators

  • treywashington
  • lwc-admin