File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 133133 function onOpen ( event ) {
134134 $log . debug ( 'wsClient connected to [' + options . url + ']' ) ;
135135 $log . debug ( event ) ;
136+ if ( options . callbacks . onOpen ) {
137+ options . callbacks . onOpen ( ) ;
138+ }
136139
137140 // no need for reconnecting
138141 if ( reconnectInterval ) {
153156 function onClose ( event ) {
154157 $log . debug ( 'wsClient connection to [' + options . url + '] closed' ) ;
155158 $log . debug ( event ) ;
159+ if ( options . callbacks . onClose ) {
160+ options . callbacks . onClose ( ) ;
161+ }
156162
157163 // no need for this if disconnected
158164 if ( keepAliveInterval ) {
181187 function onError ( event ) {
182188 $log . debug ( 'wsClient connection to [' + options . url + '] error' ) ;
183189 $log . error ( event ) ;
190+ if ( options . callbacks . onError ) {
191+ options . callbacks . onError ( ) ;
192+ }
184193 }
185194 } ;
186195 }
You can’t perform that action at this time.
0 commit comments