Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs consistency #1171

Merged
merged 2 commits into from
Oct 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ Unsubscribe from a topic or topics

-------------------------------------------------------
<a name="end"></a>
### mqtt.Client#end([force], [options], [cb])
### mqtt.Client#end([force], [options], [callback])

Close the client, accepts the following options:

Expand All @@ -505,19 +505,19 @@ Close the client, accepts the following options:
* `reasonString`: representing the reason for the disconnect `string`,
* `userProperties`: The User Property is allowed to appear multiple times to represent multiple name, value pairs `object`,
* `serverReference`: String which can be used by the Client to identify another Server to use `string`
* `cb`: will be called when the client is closed. This parameter is
* `callback`: will be called when the client is closed. This parameter is
optional.

-------------------------------------------------------
<a name="removeOutgoingMessage"></a>
### mqtt.Client#removeOutgoingMessage(mid)
### mqtt.Client#removeOutgoingMessage(mId)

Remove a message from the outgoingStore.
The outgoing callback will be called with Error('Message removed') if the message is removed.

After this function is called, the messageId is released and becomes reusable.

* `mid`: The messageId of the message in the outgoingStore.
* `mId`: The messageId of the message in the outgoingStore.

-------------------------------------------------------
<a name="reconnect"></a>
Expand Down Expand Up @@ -715,15 +715,15 @@ import mqtt from 'mqtt';
export default () => {
const [connectionStatus, setConnectionStatus] = React.useState(false);
const [messages, setMessages] = React.useState([]);

useEffect(() => {
const client = mqtt.connect(SOME_URL);
client.on('connect', () => setConnectionStatus(true));
client.on('message', (topic, payload, packet) => {
setMessages(messages.concat(payload.toString()));
});
}, []);

return (
<>
{lastMessages.map((message) => (
Expand Down