Created
June 8, 2018 23:44
-
-
Save Lucifier129/8af19bf2f249624c4031a5643b9bdc47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { render } from 'react-dom' | |
import { toReactComponent } from 'rxjs-react/operators' | |
import { from, of } from 'rxjs' | |
import { delay, scan, concatMap } from 'rxjs/operators' | |
const App = from('hello rxjs-react!').pipe( | |
concatMap(char => of(char).pipe(delay(300))), | |
scan((str, char) => str + char, ''), | |
toReactComponent(text => { | |
return ( | |
<div> | |
<h1>{text}</h1> | |
</div> | |
) | |
}) | |
) | |
render(<App />, document.getElementById('root')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment