@protonprotocol/anchor-link-browser-transport
v2.1.3
Published
Vanilla JS browser transport for Anchor Link
Downloads
6
Keywords
Readme
Anchor Link - Browser Transport
A transport library for usage of Anchor Link within a web browser environment.
Basic usage
A transport is required for Anchor Link to communicate with clients. In most examples we use the browser transport with no configuration, like so:
const transport = new AnchorLinkBrowserTransport()
const link = new AnchorLink({transport})
Parameters can be passed to the transport during construction as an object, allowing for the following optional changes:
const transport = new AnchorLinkBrowserTransport({
/** CSS class prefix, defaults to `anchor-link` */
classPrefix: 'my-css-prefix',
/** Whether to inject CSS styles in the page header, defaults to true. */
injectStyles: true,
/** Whether to display request success and error messages, defaults to true */
requestStatus: false,
/** Local storage prefix, defaults to `anchor-link`. */
storagePrefix: 'my-localstorage-prefix',
})
const link = new AnchorLink({transport})
Developing
You need Make, node.js and yarn installed.
Clone the repository and run make
to checkout all dependencies and build the project. See the Makefile for other useful targets. Before submitting a pull request make sure to run make lint
.
License
Made with ☕️ & ❤️ by Greymass, if you find this useful please consider supporting us.