tools_dj 1.0.49 → 1.0.50
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/lib/msg.d.ts +10 -0
- package/lib/msg.js +1 -1
- package/package.json +1 -1
package/lib/msg.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ declare function storeRead(store: any, callBack: any): void;
|
|
|
15
15
|
* content: bus 消息发送 即使数据相同也可以触发
|
|
16
16
|
*/
|
|
17
17
|
declare function busSend(type: any, data: any): void;
|
|
18
|
+
/** 2024/12/25 10:05 User: DJ
|
|
19
|
+
* content: 根据函数取消订阅
|
|
20
|
+
*/
|
|
21
|
+
declare function busOff(type: any, data: any): void;
|
|
22
|
+
/** 2024/12/25 10:05 User: DJ
|
|
23
|
+
* content: 关闭同名监听
|
|
24
|
+
*/
|
|
25
|
+
declare function busDown(type: any): void;
|
|
18
26
|
/** 2024/12/25 10:05 User: DJ
|
|
19
27
|
* content: bus 消息接收 注意消息接收应当在消息发送之前不然接收不到消息
|
|
20
28
|
*/
|
|
@@ -26,5 +34,7 @@ declare const _default: {
|
|
|
26
34
|
busSend: typeof busSend;
|
|
27
35
|
busRead: typeof busRead;
|
|
28
36
|
mitt: typeof mitt;
|
|
37
|
+
busOff: typeof busOff;
|
|
38
|
+
busDown: typeof busDown;
|
|
29
39
|
};
|
|
30
40
|
export default _default;
|
package/lib/msg.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.pageSend=
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.pageSend=o,exports.pageRead=s;const e=require("tslib");let t=new BroadcastChannel("msgCenter");const n=e.__importDefault(require("mitt")),a=(0,n.default)();function o(e,n){t.postMessage({type:e,data:n})}function s(e,n){t.onmessage=({data:t})=>{e==t.type&&n&&n(t.data)}}exports.default={pageSend:o,pageRead:s,storeRead:function(e,t){e.$subscribe(((e,n)=>{t&&t(n)}))},busSend:function(e,t){a.emit(e,t)},busRead:function(e,t){a.on(e,(e=>{t&&t(e)}))},mitt:n.default,busOff:function(e,t){a.off(e,t)},busDown:function(e){a.off(e)}};
|