Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ReactjsとRxJS

 ReactjsとRxJS

ReactjsとRxJSを組み合わせた実装について
react-mviについて

More Decks by Taketoshi Aono(青野健利 a.k.a brn)

Other Decks in Programming

Transcript

  1. react-mvi import { Tags as T } from '@react-mvi/core'; class

    Component extends React.Component { render() { <T.Div> <h1>{this.props.text.map(v => v + ' World')}</h1> </T.Div> } }
  2. react-mvi import { createModule, Injector, inject } from '@react-mvi/core'; import

    { MyService } from './myservice'; class MyComponent { @inject() private myService; ... } const module = createModule(config => { config.bind('myService').to(MyService).asSingleton(); }); const injector = new Injector([module]); const myComponent = injector.inject(MyComponent);
  3. react-mvi import React from 'react' import { createModule, Injector, inject,

    run } from '@react-mvi/core'; import { MyService } from './myservice'; class MyComponent extends React.Component { @inject() private myService; ... } const module = createModule(config => { config.bind('myService').to(MyService).asSingleton(); }); const injector = new Injector([module]); run({component: MyComponent, injector}); // SAME AS ReactDOM.render