Skip to content

Instantly share code, notes, and snippets.

@lorenzojkrl
Last active March 21, 2022 10:12
Show Gist options
  • Save lorenzojkrl/29715c917b925113bf5ee6b51833786f to your computer and use it in GitHub Desktop.
Save lorenzojkrl/29715c917b925113bf5ee6b51833786f to your computer and use it in GitHub Desktop.
Create a React component to use RxJS interval
import React, { useState, useEffect } from 'react';
import './style.css';
import { interval } from 'rxjs';
export default function App() {
const [state, setState] = useState();
return (
<div>
<h1>Hello RxJS!</h1>
<p>Observable value: {state}</p>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment