@w3ux/observables-connect 0.9.21 → 0.9.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounts/index.d.ts +2 -0
- package/accounts/index.js +2 -0
- package/accounts/index.js.map +1 -1
- package/accounts/state.d.ts +3 -0
- package/accounts/state.js +13 -0
- package/accounts/state.js.map +1 -0
- package/package.json +1 -1
package/accounts/index.d.ts
CHANGED
package/accounts/index.js
CHANGED
package/accounts/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/accounts/index.ts"],"names":[],"mappings":"AAGA,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA","file":"index.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport * from './get'\nexport * from './local'\nexport * from './util'\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/accounts/index.ts"],"names":[],"mappings":"AAGA,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA","file":"index.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport * from './get'\nexport * from './local'\nexport * from './observables'\nexport * from './state'\nexport * from './util'\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const unsubs = {};
|
|
2
|
+
export const addUnsub = (id, unsub) => {
|
|
3
|
+
unsubs[id] = unsub;
|
|
4
|
+
};
|
|
5
|
+
export const unsubAll = () => {
|
|
6
|
+
Object.values(unsubs).forEach((unsub) => {
|
|
7
|
+
unsub();
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=state.js.map
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/accounts/state.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,MAAM,GAA+B,EAAE,CAAA;AAGpD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAU,EAAE,KAAiB,EAAE,EAAE;IACxD,MAAM,CAAC,EAAE,CAAC,GAAG,KAAK,CAAA;AACpB,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACtC,KAAK,EAAE,CAAA;IACT,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","file":"state.js","sourcesContent":["/* @license Copyright 2024 w3ux authors & contributors\nSPDX-License-Identifier: GPL-3.0-only */\n\nexport const unsubs: Record<string, () => void> = {}\n\n// Add an extension id to unsub state\nexport const addUnsub = (id: string, unsub: () => void) => {\n unsubs[id] = unsub\n}\n\n// Unsubscribe to all unsubs\nexport const unsubAll = () => {\n Object.values(unsubs).forEach((unsub) => {\n unsub()\n })\n}\n"]}
|