Skip to content

Instantly share code, notes, and snippets.

Created Jun 27, 2018
What would you like to do?
Using observables in react app
import * as React from "react";
import { httpGet } from "./service";
import "./App.css";
import logo from "./logo.svg";
class App extends React.Component {
constructor({}) {
super({}, null);
next: data => {
error: err => {
public render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
<p className="App-intro">
To get started, edit <code>src/App.tsx</code> and save to reload.
export default App;
import axios from "axios";
import { from } from "rxjs";
export function httpGet(url) {
return from(axios.get(url));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment