UNPKG

2.03 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/components/AppConfig/AppConfigHoc.js"],"names":["AppConfigHoc","action","ev","WrappedComponent","callParent","event","source","postMessage","origin","window","addEventListener","receiveMessage","props","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBASwBA,Y;;AANxB;;;;AACA;;AACA;;AACA;;IAAYC,M;;;;;;AANZ;;;AAOA,IAAIC,KAAK,EAAT;AAEe,SAASF,YAAT,CAAuBG,gBAAvB,EAA0C;AAAA;;AACrD,kBAFH,yBAAQ;AAAA,eAAU,EAAV;AAAA,KAAR,6BAA4BF,MAA5B,EAEG;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,2CAEkB;AACV,qBAAKG,UAAL;AACH;AAJL;AAAA;AAAA,2CAKmBC,KALnB,EAK0B;AAClBH,qBAAKG,KAAL;AACH;AAPL;AAAA;AAAA,yCASiB;AACTH,sBAAMA,GAAGI,MAAT,IAAmBJ,GAAGI,MAAH,CAAUC,WAA7B,IAA4CL,GAAGI,MAAH,CAAUC,WAAV,CAAsB,IAAtB,EAA4BL,GAAGM,MAA/B,CAA5C;AACH;AAXL;AAAA;AAAA,gDAauB;AACfC,uBAAOC,gBAAP,CAAwB,SAAxB,EAAmC,KAAKC,cAAxC,EAAwD,KAAxD;AACH;AAfL;AAAA;AAAA,qCAiBa;AACL,uBACA,8BAAC,gBAAD,6BAAsB,KAAKC,KAA3B,IAAkC,YAAc,KAAKR,UAArD,EAAiE,kBAAiB,UAAlF,IADA;AAGH;AArBL;AAAA;AAAA,MAAqBS,gBAArB;AAuBH","file":"AppConfigHoc.js","sourcesContent":["/**\r\n * Created by huangxiao3 on 2018/5/31.\r\n */\r\nimport React, { Component } from 'react';\r\nimport './style.css'\r\nimport { connect } from 'react-redux';\r\nimport * as action from './redux';\r\nlet ev = '';\r\n@connect(state => ({}), { ...action })\r\nexport default function AppConfigHoc (WrappedComponent) {\r\n return class extends Component {\r\n\r\n handleSubmit(){\r\n this.callParent();\r\n }\r\n receiveMessage(event) {\r\n ev = event;\r\n }\r\n\r\n callParent() {\r\n ev && ev.source && ev.source.postMessage && ev.source.postMessage('ok', ev.origin);\r\n }\r\n\r\n componentDidMount(){\r\n window.addEventListener('message', this.receiveMessage, false);\r\n }\r\n\r\n render() {\r\n return (\r\n <WrappedComponent {...this.props} callParent = {this.callParent} testPropsFromHoc=\"aahahahh\"/>\r\n );\r\n }\r\n }\r\n}"]}
\No newline at end of file