0.1.0 • Published 6 years ago
@justbe-native-js/fetch-api v0.1.0
Javascript Fetch api powered by Rxjs
Wrapper around javascript fetch api using rxjs methods and operators.
Installation
Use the node package manager npm to install @justbe-native-js/fetch-api.
npm install @justbe-native-js/fetch-api --save
Usage
import { FetchApi } from '@justbe-native-js/fetch-api';
constructor(){
let url = 'https://jsonplaceholder.typicode.com/posts/1';
let options = {};
FetchApi.fetch(url, options).subscribe(res => {
console.log(res);
})
}
Fetch api options
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';//default GET;
headers?: any;
body?: any;