Compare commits
4 Commits
v0.0.2-dev
...
v0.0.2-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 807d9376a0 | |
Derrick Hammer | 7eabf6a05d | |
Derrick Hammer | 50335dd062 | |
Derrick Hammer | 0c18c92521 |
|
@ -1,3 +1,11 @@
|
||||||
|
## [0.0.2-develop.12](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.0.2-develop.11...v0.0.2-develop.12) (2023-07-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* change on to always return an instance of emittery unsubscribe function ([0c18c92](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/commit/0c18c92521de8b8685882b88ad8efa74a76617c6))
|
||||||
|
* return type required ([7eabf6a](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/commit/7eabf6a05da9dcd833b55f386896a70fa6ec736d))
|
||||||
|
|
||||||
## [0.0.2-develop.11](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.0.2-develop.10...v0.0.2-develop.11) (2023-07-22)
|
## [0.0.2-develop.11](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.0.2-develop.10...v0.0.2-develop.11) (2023-07-22)
|
||||||
|
|
||||||
## [0.0.2-develop.10](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.0.2-develop.9...v0.0.2-develop.10) (2023-07-22)
|
## [0.0.2-develop.10](https://git.lumeweb.com/LumeWeb/kernel-swarm-client/compare/v0.0.2-develop.9...v0.0.2-develop.10) (2023-07-22)
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/kernel-swarm-client",
|
"name": "@lumeweb/kernel-swarm-client",
|
||||||
"version": "0.0.2-develop.11",
|
"version": "0.0.2-develop.12",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/kernel-swarm-client",
|
"name": "@lumeweb/kernel-swarm-client",
|
||||||
"version": "0.0.2-develop.11",
|
"version": "0.0.2-develop.12",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lumeweb/libkernel": "^0.1.0-develop.9",
|
"@lumeweb/libkernel": "^0.1.0-develop.9",
|
||||||
"async-mutex": "^0.4.0",
|
"async-mutex": "^0.4.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/kernel-swarm-client",
|
"name": "@lumeweb/kernel-swarm-client",
|
||||||
"version": "0.0.2-develop.11",
|
"version": "0.0.2-develop.12",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
10
src/index.ts
10
src/index.ts
|
@ -8,6 +8,7 @@ import b4a from "b4a";
|
||||||
import Backoff from "backoff.js";
|
import Backoff from "backoff.js";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Protomux from "protomux";
|
import Protomux from "protomux";
|
||||||
|
import { UnsubscribeFn } from "emittery";
|
||||||
|
|
||||||
export class SwarmClient extends Client {
|
export class SwarmClient extends Client {
|
||||||
private useDefaultSwarm: boolean;
|
private useDefaultSwarm: boolean;
|
||||||
|
@ -188,10 +189,10 @@ export class Socket extends Client {
|
||||||
await this.swarm.emit("setup", this);
|
await this.swarm.emit("setup", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
on(event: any, listener: any): UnsubscribeFn {
|
||||||
on(event: any, listener: any): this {
|
const parentOn = super.on(event, listener);
|
||||||
if (this.eventUpdates[event]?.has(listener)) {
|
if (this.eventUpdates[event]?.has(listener)) {
|
||||||
return this;
|
return parentOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
const [update, promise] = this.connectModule(
|
const [update, promise] = this.connectModule(
|
||||||
|
@ -207,8 +208,7 @@ export class Socket extends Client {
|
||||||
this.off(event as string, listener);
|
this.off(event as string, listener);
|
||||||
});
|
});
|
||||||
|
|
||||||
super.on(event, listener);
|
return parentOn;
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
off(event: any, listener: any): this {
|
off(event: any, listener: any): this {
|
||||||
|
|
Loading…
Reference in New Issue