2016-03-30 09:24:52 +09:00
|
|
|
import React from 'react';
|
2016-10-19 10:32:24 +02:00
|
|
|
import Telescope from 'meteor/nova:lib';
|
|
|
|
//import { messagesActions } from "../messages.js";
|
2016-02-23 13:10:08 +09:00
|
|
|
|
2016-10-19 10:32:24 +02:00
|
|
|
// import { createContainer } from 'meteor/react-meteor-data';
|
2016-02-23 13:10:08 +09:00
|
|
|
|
2016-10-19 10:32:24 +02:00
|
|
|
// const FlashContainer = createContainer(() => {
|
|
|
|
// return {
|
|
|
|
// messages: Messages.collection.find({show: true}).fetch()
|
|
|
|
// }
|
|
|
|
// }, params => <params.component {...params} />);
|
|
|
|
|
|
|
|
// FlashContainer.displayName = "FlashContainer";
|
|
|
|
|
|
|
|
// module.exports = FlashContainer;
|
|
|
|
// export default FlashContainer;
|
|
|
|
|
2016-10-31 17:13:14 +01:00
|
|
|
// note: redux test
|
2016-10-19 10:32:24 +02:00
|
|
|
import { bindActionCreators } from 'redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
2016-10-31 17:13:14 +01:00
|
|
|
const mapStateToProps = state => ({ messages: state.messages, });
|
2016-10-19 10:32:24 +02:00
|
|
|
const mapDispatchToProps = dispatch => bindActionCreators(Telescope.actions.messages, dispatch);
|
2016-02-23 13:10:08 +09:00
|
|
|
|
2016-10-19 10:32:24 +02:00
|
|
|
const FlashContainer = connect(mapStateToProps, mapDispatchToProps)((props, context) => <props.component {...props} />);
|
2016-05-22 16:42:24 +09:00
|
|
|
|
2016-02-28 18:56:58 +09:00
|
|
|
export default FlashContainer;
|