Fix missing unsubscribe return on subscribeCollect
This commit is contained in:
parent
cb060c6399
commit
c29837d850
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hibas123/utils",
|
"name": "@hibas123/utils",
|
||||||
"version": "2.2.17",
|
"version": "2.2.18",
|
||||||
"description": "Different Utilities, that are not worth own packages",
|
"description": "Different Utilities, that are not worth own packages",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
@ -62,6 +62,8 @@ export default class Observable<T = any> {
|
|||||||
|
|
||||||
let oldcb = this.subscriberCollect.find((e) => e === callback);
|
let oldcb = this.subscriberCollect.find((e) => e === callback);
|
||||||
if (!oldcb) this.subscriberCollect.push(callback);
|
if (!oldcb) this.subscriberCollect.push(callback);
|
||||||
|
|
||||||
|
return () => this.unsubscribe(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user