0.3.0 • Published 4 years ago
api_interaction_services v0.3.0
Api interaction services
All services use fp-ts library, http methods wrapper return fp-ts either.
Simple api interaction class
import { ApiInteractionService } from 'api_interaction_services';So you can use it like this:
0.2x:
const fetcher = new ApiInteractionService("http://localhost:3300");
fetcher.get('/');0.3x:
const fetcher = new ApiInteractionService("http://localhost:3300");
fetcher.get('/')();Indendity interaction service
A more powerful tool that allows you to communicate with a closed API that requires access and refresh tokens.
import { BearerApiInteractionService } from 'api_interaction_services';Inversify
Or you can use this classes with inverisify in a few steps:
- Declare SERVICE_IDENTIFIER name for service
export const SERVICE_IDENTIFIER = {
ApiInteractionService: Symbol.for("ApiInteractionService"),
};- Bind this name to class with url to your API
container.bind<ApiInteractionService>(SERVICE_IDENTIFIER.ApiInteractionService).toConstantValue(new ApiInteractionService(API_URL));- And now you can inject this service to your class
constructor(@inject(SERVICE_IDENTIFIER.ApiInteractionService) protected _apiService: ApiInteractionService) {}0.3.0
4 years ago
0.2.15
4 years ago
0.2.14
4 years ago
0.2.12
4 years ago
0.2.11
4 years ago
0.2.10
4 years ago
0.2.9
4 years ago
0.2.8
4 years ago
0.2.7
4 years ago
0.2.5
4 years ago
0.2.4
4 years ago
0.2.1
4 years ago
0.2.0
4 years ago
0.2.3
4 years ago
0.1.4
4 years ago
0.2.2
4 years ago
0.1.5
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago
0.1.0
4 years ago