I'm trying to es6-ify the following React-Reflux code:
var TimeStore = Reflux.createStore({
listenables: [TimeActions],
onTick: function(tick) {
....
}
})
var Watch = React.createClass({
mixins: [Reflux.connect(TimeStore, 'tick')],
...
I'm not sure how to convert this using react-decorator. This is what I've transformed it to:
const SomeDecorator = MixinDecorator(
'TimerActions', // displayName
Reflux.connect(TimeStore, 'tick')
);
@SomeDecorator
class Watch extends React.Component {
...
It compiles with babel (with stage
set to 0
) but doesn't work very well. Any suggestions how to fix this ? Also, is it possible to es6-ify the store ?