This commit is contained in:
marlon-erler
2024-07-07 16:56:24 +02:00
parent b047f1b5e8
commit 87241bac45
119 changed files with 0 additions and 10050 deletions
-29
View File
@@ -1,29 +0,0 @@
# udn-frontend
TypeScript library for [UDN](https://github.com/marlon-erler/universal-decentralized-network) apps
# Install
`npm install udn-frontend`
# Usage
```TypeScript
import UDNFrontend from "udn-frontend";
// setup
const UDN = new UDNFrontend();
UDN.onconnect = () => {
console.log("connected!");
};
UDN.ondisconnect = () => {
console.log("disconnected!");
};
UDN.onmessage = (data) => {
console.log(data);
};
// do stuff
UDN.connect("ws://192.168.0.69:1234");
UDN.subscribe("my-channel");
UDN.sendMessage("my-channel", "Hello, world!");
UDN.unsubscribe("my-channel");
```