Skip to content

Instantly share code, notes, and snippets.

@hufeng
Created July 20, 2015 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hufeng/b5a4ac3138191e3fc981 to your computer and use it in GitHub Desktop.
Save hufeng/b5a4ac3138191e3fc981 to your computer and use it in GitHub Desktop.
iflux es6
/**
* React支持es6的class语法,但是在class中并没有一个很好的概念来对应mixin
*
* 我们也要考虑弱化mixin
*
* 那怎么做呢?使用高阶函数来解决这个问题
*
* 但是有个难点还会是需要再想想,怎么把store的更新和react的render结合起来,做到透明
* 比如
*/
import React from 'react';
import appStore from './store';
/**
* high functional
*/
let App = appStore.createContainer(class App extends React.Component {
render() {
return (
<ul>
<li>username: { this.props.username }</li>
<li>email: { this.prpps.email }</li>
</ul>
);
}
});
React.render(<App/>, document.body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment