1 | import React from 'react';
|
2 | import PubSub from 'pubsub-js';
|
3 |
|
4 | import { Layout } from 'antd';
|
5 |
|
6 | const {Content} = Layout;
|
7 |
|
8 |
|
9 | export default class ContentView extends React.Component {
|
10 | constructor(props) {
|
11 | super(props);
|
12 |
|
13 | var mySubscriber = function( msg, data ){
|
14 | console.log( msg, data );
|
15 | };
|
16 |
|
17 | var token = PubSub.subscribe( 'MY TOPIC', mySubscriber );
|
18 | }
|
19 |
|
20 | render() {
|
21 | return (
|
22 | <Content style={{ background: '#fff', padding: 24, margin: 0, minHeight: 280 }}>
|
23 | Content
|
24 | </Content>
|
25 | )
|
26 | }
|
27 | } |
\ | No newline at end of file |