Package Exports
- @xmpp/reconnect
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@xmpp/reconnect) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
reconnect
Auto reconnect for @xmpp/client and @xmpp/component.
Included and enabled in @xmpp/component and @xmpp/client.
Supports Node.js and browsers.
Each reconnect will re-use the options provided to the entity start method.
delay property
Property to set/get the delay in milliseconds between connection closed and reconnecting.
Default is 1000.
reconnect.delay // 1000
reconnect.delay = 2000reconnecting event
Emitted each time a re-connection is attempted.
reconnect.on('reconnecting', () => {
console.log('reconnecting')
})reconnected event
Emitted each time a re-connection succeed.
reconnect.on('reconnected', () => {
console.log('reconnected')
})error event
Emitted on entity each time a re-connection fails.
entity.on('error', err => {
console.error(err)
})