File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 "homepage" : " https://github.com/coma/react-socket" ,
55 "repository" : " https://github.com/coma/react-socket" ,
66 "main" : " ./src/index.js" ,
7- "version" : " 0.1.1 " ,
7+ "version" : " 0.1.2 " ,
88 "license" : " MIT" ,
99 "private" : false ,
1010 "authors" : [
Original file line number Diff line number Diff line change @@ -16,13 +16,12 @@ module.exports = React.createClass({
1616 } ,
1717 componentWillMount : function ( ) {
1818
19- Socket ( this . props . socket )
20- . on ( this . props . name , this . props . callback ) ;
19+ this . socket = Socket ( this . props . socket ) ;
20+ this . socket . on ( this . props . name , this . props . callback ) ;
2121 } ,
2222 componentWillUnmount : function ( ) {
2323
24- Socket ( this . props . socket )
25- . off ( this . props . name , this . props . callback ) ;
24+ this . socket . off ( this . props . name , this . props . callback ) ;
2625 } ,
2726 render : function ( ) {
2827
You can’t perform that action at this time.
0 commit comments