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
/** @jsx h */ | |
function h(type, props, ...children) { | |
let renderer = h.renderer; | |
renderer.input(); | |
renderer.type(type); | |
renderer.propsStart(); | |
for (let key in props) { | |
renderer.propStart(); | |
renderer.prop(key, props[key]); |
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
/** @jsx h */ | |
class Scheme { | |
constructor(type, props, children) { | |
this.type = type; | |
this.props = props; | |
this.children = children; | |
} | |
} |
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 { reactive } from 'rxjs-react' | |
import { from, of } from 'rxjs' | |
import { map, delay, scan, concatMap } from 'rxjs/operators' | |
const App = reactive(() => { | |
const hello$ = from('hello rxjs-react!').pipe( | |
concatMap(char => of(char).pipe(delay(300))), | |
scan((str, char) => str + char, ''), |
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 => { |
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 { reactive } from 'rxjs-react' | |
import { interval } from 'rxjs' | |
const app = reactive(<h1>{interval(10)}</h1>) | |
render(app, document.getElementById('root')) |
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 { reactive } from 'rxjs-react' | |
import { interval } from 'rxjs' | |
const Count = props => <h1>count {props.count} from reactive props</h1> | |
const app = reactive(<Count count={interval(10)} />) | |
render(app, document.getElementById('root')) |
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 { reactive } from 'rxjs-react' | |
import { Subject, merge, interval } from 'rxjs' | |
import { map, mapTo, scan, startWith } from 'rxjs/operators' | |
@reactive | |
class App extends React.PureComponent { | |
incre$ = new Subject() | |
decre$ = new Subject() |
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 { reactive } from 'rxjs-react' | |
import { interval } from 'rxjs' | |
const App = reactive(props => <h1>count {interval(props.period)}</h1>) | |
render(<App period={10} />, document.getElementById('root')) |
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 ReactDOM from 'react-dom' | |
import { reactive } from 'rxjs-react' | |
import { interval } from 'rxjs' | |
import { map, startWith, switchMap } from 'rxjs/operators' | |
const App$ = reactive(() => { | |
let Type$ = interval(1000).pipe( | |
startWith(0), | |
map(value => `h${value % 6 + 1}`) |
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 ReactDOM from 'react-dom' | |
import { reactive } from 'rxjs-react' | |
import { from } from 'rxjs' | |
import { map } from 'rxjs/operators' | |
@reactive | |
class App extends React.Component { | |
data$ = from(fetch(this.props.url).then(res => res.json())) | |
render() { |