Package Exports
- @xmpp/resource-binding
- @xmpp/resource-binding/index.js
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/resource-binding) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
resource-binding
Resource binding for @xmpp/client.
Included and enabled in @xmpp/client.
Usage
Resource is optional and will be chosen by the server if omitted.
string
import { xmpp } from "@xmpp/client";
const client = xmpp({ resource: "laptop" });function
Instead, you can provide a function that will be called every time resource binding occurs (every (re)connect).
import { xmpp } from "@xmpp/client";
const client = xmpp({ resource: onBind });
async function onBind(bind) {
const resource = await fetchResource();
return resource;
}