From b31bf86947f5a1cf094f8839b9efcc30cc4d0c36 Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Fri, 21 Sep 2018 02:48:15 +0800 Subject: [PATCH 1/2] refs #76 Bump up version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0421d1..8c70b15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-stomp", - "version": "3.3.0", + "version": "4.0.0", "description": "React websocket component with STOMP over SockJS", "main": "./dist/client.js", "nyc": { From 63a9c2fee36c23a3b89e36a1c863ac8c07e86efe Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Fri, 21 Sep 2018 02:54:02 +0800 Subject: [PATCH 2/2] refs #76 Updated API docs. --- API.md | 151 ++++++++++++++------------------------------------------- 1 file changed, 37 insertions(+), 114 deletions(-) diff --git a/API.md b/API.md index b3f2a2a..17673f2 100644 --- a/API.md +++ b/API.md @@ -1,30 +1,3 @@ - - -### Table of Contents - -- [SockJsClient][1] - - [Parameters][2] - - [connect][3] - - [disconnect][4] - - [sendMessage][5] - - [Parameters][6] -- [url][7] -- [options][8] -- [topics][9] -- [onConnect][10] -- [onDisconnect][11] -- [getRetryInterval][12] - - [Parameters][13] -- [onMessage][14] - - [Parameters][15] -- [headers][16] -- [subscribeHeaders][17] -- [autoReconnect][18] -- [debug][19] -- [heartbeat][20] -- [heartbeatIncoming][21] -- [heartbeatOutgoing][22] - ## SockJsClient [src/client.jsx:15-271][23] @@ -34,16 +7,8 @@ - **See: [STOMP][24]** - **See: [StompJS][25]** -React component for SockJS-client with STOMP messaging protocol. - -### Parameters - -- `props` - -**Meta** -- **version**: 4.0.0 -- **author**: \[lahsivjar] (https://github.com/lahsivjar) +## Methods ### connect @@ -71,13 +36,15 @@ Send message to the specified topic. - `msg` **[string][30]** message to send - `opt_headers` **[Object][31]** additional headers for underlying STOMP client (optional, default `{}`) -## url +## Props + +### url [src/client.jsx:32-32][32] HTTP URL of the endpoint to connect. -## options +### options [src/client.jsx:38-38][33] @@ -85,177 +52,133 @@ HTTP URL of the endpoint to connect. Additional options to pass to the underlying SockJS constructor. -## topics +### topics [src/client.jsx:42-42][35] Array of topics to subscribe to. -## onConnect +### onConnect [src/client.jsx:46-46][36] Callback after connection is established. -## onDisconnect +### onDisconnect [src/client.jsx:50-50][37] Callback after connection is lost. -## getRetryInterval +### getRetryInterval [src/client.jsx:56-56][38] Gets called to find the time interval for next retry. Defaults to a function returing retryCount seconds. -### Parameters +#### Parameters - `retryCount` **[number][39]** number of retries for the current disconnect -## onMessage +### onMessage [src/client.jsx:63-63][40] Callback when a message is recieved. -### Parameters +#### Parameters - `msg` **([string][30] \| [Object][31])** message received from server, if JSON format then object - `topic` **[string][30]** the topic on which the message was received -## headers +### headers [src/client.jsx:67-67][41] Headers that will be passed to the server or broker with STOMP's connection frame. -## subscribeHeaders +### subscribeHeaders [src/client.jsx:71-71][42] Headers that will be passed when subscribing to a destination. -## autoReconnect +### autoReconnect [src/client.jsx:75-75][43] Should the client try to automatically connect in an event of disconnection. -## debug +### debug [src/client.jsx:79-79][44] Enable debugging mode. -## heartbeat +### heartbeat [src/client.jsx:83-83][45] Number of milliseconds to send and expect heartbeat messages. -## heartbeatIncoming +### heartbeatIncoming [src/client.jsx:87-87][46] Number of milliseconds to expect heartbeat messages -## heartbeatOutgoing +### heartbeatOutgoing [src/client.jsx:91-91][47] Number of milliseconds to send heartbeat messages -[1]: #sockjsclient - -[2]: #parameters - -[3]: #connect - -[4]: #disconnect - -[5]: #sendmessage - -[6]: #parameters-1 - -[7]: #url - -[8]: #options - -[9]: #topics - -[10]: #onconnect - -[11]: #ondisconnect - -[12]: #getretryinterval - -[13]: #parameters-2 - -[14]: #onmessage - -[15]: #parameters-3 - -[16]: #headers - -[17]: #subscribeheaders - -[18]: #autoreconnect - -[19]: #debug - -[20]: #heartbeat - -[21]: #heartbeatincoming - -[22]: #heartbeatoutgoing - -[23]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L15-L271 "Source code on GitHub" +[23]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L15-L271 "Source code on GitHub" [24]: https://stomp.github.io/ [25]: https://github.com/sockjs/sockjs-client -[26]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L224-L229 "Source code on GitHub" +[26]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L224-L229 "Source code on GitHub" [27]: #sockjsclientdisconnect -[28]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L236-L254 "Source code on GitHub" +[28]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L236-L254 "Source code on GitHub" -[29]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L264-L270 "Source code on GitHub" +[29]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L264-L270 "Source code on GitHub" [30]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String [31]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[32]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L32-L32 "Source code on GitHub" +[32]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L32-L32 "Source code on GitHub" -[33]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L38-L38 "Source code on GitHub" +[33]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L38-L38 "Source code on GitHub" [34]: https://github.com/sockjs/sockjs-client#sockjs-client-api -[35]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L42-L42 "Source code on GitHub" +[35]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L42-L42 "Source code on GitHub" -[36]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L46-L46 "Source code on GitHub" +[36]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L46-L46 "Source code on GitHub" -[37]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L50-L50 "Source code on GitHub" +[37]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L50-L50 "Source code on GitHub" -[38]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L56-L56 "Source code on GitHub" +[38]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L56-L56 "Source code on GitHub" [39]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[40]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L63-L63 "Source code on GitHub" +[40]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L63-L63 "Source code on GitHub" -[41]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L67-L67 "Source code on GitHub" +[41]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L67-L67 "Source code on GitHub" -[42]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L71-L71 "Source code on GitHub" +[42]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L71-L71 "Source code on GitHub" -[43]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L75-L75 "Source code on GitHub" +[43]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L75-L75 "Source code on GitHub" -[44]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L79-L79 "Source code on GitHub" +[44]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L79-L79 "Source code on GitHub" -[45]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L83-L83 "Source code on GitHub" +[45]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L83-L83 "Source code on GitHub" -[46]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L87-L87 "Source code on GitHub" +[46]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L87-L87 "Source code on GitHub" -[47]: https://github.com/lahsivjar/react-stomp/blob/9b641860d1382bfde5317d5891e83afebdb0ca39/src/client.jsx#L91-L91 "Source code on GitHub" +[47]: https://github.com/lahsivjar/react-stomp/blob/b31bf86947f5a1cf094f8839b9efcc30cc4d0c36/src/client.jsx#L91-L91 "Source code on GitHub"