Compare commits
3 Commits
v0.0.2-dev
...
v0.0.2-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 9c83c96f36 | |
Derrick Hammer | 621a0f3cb0 | |
Derrick Hammer | a92630172d |
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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",
|
||||
|
|
10
src/index.ts
10
src/index.ts
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue