Compare commits

...

3 Commits

4 changed files with 15 additions and 3 deletions

View File

@ -1 +1,3 @@
## [0.0.2-develop.2](https://git.lumeweb.com/LumeWeb/rpc/compare/v0.0.2-develop.1...v0.0.2-develop.2) (2023-07-04)
## [0.0.2-develop.1](https://git.lumeweb.com/LumeWeb/rpc/compare/v0.0.1...v0.0.2-develop.1) (2023-07-01)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@lumeweb/rpc",
"version": "0.0.2-develop.1",
"version": "0.0.2-develop.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@lumeweb/rpc",
"version": "0.0.2-develop.1",
"version": "0.0.2-develop.2",
"dependencies": {
"compact-encoding": "2.12.0",
"protomux-rpc": "1.4.0"

View File

@ -1,7 +1,7 @@
{
"name": "@lumeweb/rpc",
"type": "module",
"version": "0.0.2-develop.1",
"version": "0.0.2-develop.2",
"main": "lib/index.js",
"repository": {
"type": "git",

View File

@ -6,6 +6,8 @@ import b4a from "b4a";
const ID = b4a.from("lumeweb");
export default class RPC extends ProtomuxRPC {
private _ready: Promise<void>;
constructor(stream: any, options = {}) {
options = {
...{
@ -15,9 +17,17 @@ export default class RPC extends ProtomuxRPC {
...options,
};
super(stream, options);
this._ready = new Promise((resolve) => {
// @ts-ignore
this.on("open", resolve);
});
}
async request(method: any, value: any | string = "", options = {}) {
return super.request(method, value, options);
}
get ready(): Promise<void> {
return this._ready;
}
}