Recompose provides helper functions to stream props using an Observable library of your choice into React. This lesson shows you how to configure Recompose to use RxJS then create a Streaming Component with Recompose’s componentFromStream helper function.

  1. import React from "react"
  2. import { render } from "react-dom"
  3. import { Observable } from "rxjs"
  4. import config from "recompose/rxjsObservableConfig"
  5. import {
  6. setObservableConfig,
  7. componentFromStream
  8. } from "recompose"
  9.  
  10. setObservableConfig(config)
  11.  
  12. /*
  13. APP Start
  14. */
  15.  
  16. const App = componentFromStream(props$ => props$.map(props => <h1>{props.message}</h1>))
  17.  
  18. render(<App message="Hello World!" />, document.getElementById("root"))

[Recompose] Configure Recompose to Build React Components from RxJS Streams的更多相关文章

  1. [React] Recompose: Theme React Components Live with Context

    SASS Bootstrap allows us to configure theme or branding variables that affect all components (e.g. P ...

  2. [Recompose] Create Stream Behaviors to Push Props in React Components with mapPropsStream

    Rather than using Components to push streams into other Components, mapPropsStream allows you to cre ...

  3. [React] Styling React Components With Aphrodite

    Aphrodite is a library styling React components. You get all the benefits of inline styles (encapsul ...

  4. Rendering React components to the document body

    React一个比较好用的功能是其简单的API,一个组件可以简单到一个return了组件结构的render函数.除了一个简单的函数之外,我们还有了一段有用且可复用的代码片段. 问题 不过有时候可能会受到 ...

  5. React Components Template

    React Components Template "use strict"; /** * * @author xgqfrms * @license MIT * @copyrigh ...

  6. Installing Wine 1.5: configure: error: Cannot build a 32-bit program, you need to install 32-bit development libraries(转载)

    Installing Wine 1.5: configure: error: Cannot build a 32-bit program, you need to install 32-bit dev ...

  7. [React] Create and import React components with Markdown using MDXC

    In this lesson I demonstrate how to use the library MDXC to create and import React components with ...

  8. React Components之间的通信方式了解下

    先来几个术语: 官方 我的说法 对应代码 React element React元素 let element=<span>A爆了</span> Component 组件 cla ...

  9. [Poi] Use Markdown as React Components by Adding a Webpack Loader to Poi

    Poi ships with many webpack loaders included, but you may run into scenarios where you'll need to cu ...

随机推荐

  1. ftp 一个账号多个家目录的解决方案

    通常,配置ftp时,一个ftp账号只对应一个家目录,不能有多个家目录的情况. 但是,根据公司开发项目的需求,需要做到一个ftp对应多个开发目录.有想过创建软链接的,可是发现通过ftp是访问不了的. 举 ...

  2. BZOJ2225: [Spoj 2371]Another Longest Increasing CDQ分治,3维LIS

    Code: #include <cstdio> #include <algorithm> #include <cstring> #define maxn 20000 ...

  3. NOIp2018模拟赛四十三

    有了昨天的经验,不慌,开题先看source ******** 再看看题,看到C题标题: ******** 有毒... B题的“显然”50分结论推了我一个小时,然后就弃疗了... 成绩:0+50+5=5 ...

  4. CentOS7 部署SVN服务器

    服务器端:svnserver 安装主要步骤 yum install subversion rpm -ql subversion mkdir /application/svndata mkdir /ap ...

  5. 【BZOJ 1260】[CQOI2007]涂色paint

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 区间DP 设f[i][j]表示i..j这个区间变成目标需要的最少染色次数. f[i][i] = 1 然后考虑f[i][j]的产生方法 ...

  6. solr启动时报错org.apache.solr.common.SolrException: undefined field text的解决办法

    solr启动时报错org.apache.solr.common.SolrException: undefined field text的解决办法 原创 2015年08月21日 20:47:40 标签: ...

  7. POJ 1012 Joseph(打表题)

    题意:约瑟夫环的变形.要求寻找到一个杀人循环节m使后半节的坏人先被所有杀光. 直接链表模拟出结果,再打表即可: 代码:(凝视的是打表码) #include<iostream> #inclu ...

  8. linux 抓包 tcpdump 简单应用

    在linuxserver上,常常要定位网络问题,就须要用到抓包. 比如:tcpdump -X -s 0 host 10.17.81.22 and port 9999 -w /home/text.cap ...

  9. hdu-2871

    #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #i ...

  10. android常用控件的使用方法

    引言 xml很强大 TextView <TextView android:id="@+id/text_view" android:layout_width="mat ...