Making a GET request
import { elixor } from 'elixor';
const url = 'https://jsonplaceholder.typicode.com/posts';
export const getConfig = () => {
return elixor.get(url);
}import * as React from 'react';
import { getConfig } from './services/config.service';
class Config extends React.Component {
componentDidMount() {
getConfig()
.subscribe(r => {
console.log(r);
});
}
}
export default Config;Last updated