fastevent 1.0.4 → 1.1.1
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/.prettierrc.js +20 -0
- package/.vscode/settings.json +18 -0
- package/CHANGELOG.md +22 -6
- package/dist/devTools.d.mts +308 -0
- package/dist/devTools.d.ts +308 -0
- package/dist/devTools.js +3 -0
- package/dist/devTools.js.map +1 -0
- package/dist/devTools.mjs +3 -0
- package/dist/devTools.mjs.map +1 -0
- package/dist/index.d.mts +40 -17
- package/dist/index.d.ts +40 -17
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/example/README.md +54 -0
- package/example/eslint.config.js +28 -0
- package/example/index.html +13 -0
- package/example/package.json +29 -0
- package/example/pnpm-lock.yaml +2047 -0
- package/example/public/vite.svg +1 -0
- package/example/src/App.css +42 -0
- package/example/src/App.tsx +60 -0
- package/example/src/assets/react.svg +1 -0
- package/example/src/index.css +68 -0
- package/example/src/main.tsx +10 -0
- package/example/src/vite-env.d.ts +1 -0
- package/example/tsconfig.app.json +26 -0
- package/example/tsconfig.json +7 -0
- package/example/tsconfig.node.json +24 -0
- package/example/vite.config.ts +7 -0
- package/package.json +15 -2
- package/readme.md +275 -66
- package/readme_cn.md +275 -70
- package/src/__tests__/emit.test.ts +68 -69
- package/src/__tests__/emitAsync.test.ts +41 -42
- package/src/__tests__/many.test.ts +15 -16
- package/src/__tests__/meta.test.ts +19 -19
- package/src/__tests__/off.test.ts +162 -162
- package/src/__tests__/onany.test.ts +97 -98
- package/src/__tests__/once.test.ts +42 -43
- package/src/__tests__/retain.test.ts +36 -36
- package/src/__tests__/scope.test.ts +38 -39
- package/src/__tests__/types.test.ts +97 -80
- package/src/__tests__/waitFor.test.ts +36 -29
- package/src/__tests__/wildcard.test.ts +114 -115
- package/src/devTools.ts +166 -0
- package/src/event.ts +272 -222
- package/src/scope.ts +64 -55
- package/src/types.ts +38 -34
- package/src/utils/WeakObjectMap.ts +64 -0
- package/tsconfig.json +103 -111
- package/tsup.config.ts +17 -6
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 一个基于弱引用(WeakRef)的键值映射集合
|
|
3
|
+
*
|
|
4
|
+
* @template T - 值的类型,必须是对象类型(继承自 `object`)
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const map = new WeakObjectMap<MyObject>();
|
|
8
|
+
* map.set('key1', obj1);
|
|
9
|
+
* const retrieved = map.get('key1'); // 返回 obj1 或 undefined(如果已被垃圾回收)
|
|
10
|
+
*/
|
|
11
|
+
declare class WeakObjectMap<T extends object> {
|
|
12
|
+
private map;
|
|
13
|
+
private finalizationRegistry;
|
|
14
|
+
/**
|
|
15
|
+
* 构造一个新的 WeakObjectMap 实例
|
|
16
|
+
*/
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* 设置键值对
|
|
20
|
+
* @param key - 字符串键名
|
|
21
|
+
* @param value - 要存储的对象值(会被自动包装为弱引用)
|
|
22
|
+
*/
|
|
23
|
+
set(key: string, value: T): void;
|
|
24
|
+
/**
|
|
25
|
+
* 获取指定键对应的值
|
|
26
|
+
* @param key - 要查找的键名
|
|
27
|
+
* @returns 如果值存在且未被垃圾回收则返回值,否则返回 undefined
|
|
28
|
+
*/
|
|
29
|
+
get(key: string): T | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* 删除指定键的映射
|
|
32
|
+
* @param key - 要删除的键名
|
|
33
|
+
* @returns 如果键存在并已删除则返回 true,否则返回 false
|
|
34
|
+
*/
|
|
35
|
+
delete(key: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 检查是否存在指定键的映射(且值未被垃圾回收)
|
|
38
|
+
* @param key - 要检查的键名
|
|
39
|
+
* @returns 如果键存在且值未被回收则返回 true,否则返回 false
|
|
40
|
+
*/
|
|
41
|
+
has(key: string): boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type FastEventMessage<T = string, P = any, M = unknown> = {
|
|
45
|
+
type: T;
|
|
46
|
+
payload: P;
|
|
47
|
+
meta: M;
|
|
48
|
+
};
|
|
49
|
+
type FastEventListener<T = string, P = any, M = unknown> = (message: FastEventMessage<T, P, M>) => any | Promise<any>;
|
|
50
|
+
type FastListenerNode = {
|
|
51
|
+
__listeners: (FastEventListener<any, any, any> | [FastEventListener<any, any>, number])[];
|
|
52
|
+
} & {
|
|
53
|
+
[key: string]: FastListenerNode;
|
|
54
|
+
};
|
|
55
|
+
type FastEventSubscriber = {
|
|
56
|
+
off: () => void;
|
|
57
|
+
};
|
|
58
|
+
type FastListeners = FastListenerNode;
|
|
59
|
+
type FastEventOptions<M = unknown> = {
|
|
60
|
+
id?: string;
|
|
61
|
+
debug?: boolean;
|
|
62
|
+
delimiter?: string;
|
|
63
|
+
context?: any;
|
|
64
|
+
ignoreErrors?: boolean;
|
|
65
|
+
onListenerError?: ((type: string, error: Error) => void);
|
|
66
|
+
meta?: M;
|
|
67
|
+
onAddListener?: (type: string[], listener: FastEventListener) => void;
|
|
68
|
+
onRemoveListener?: (type: string[], listener: FastEventListener) => void;
|
|
69
|
+
onClearListeners?: () => void;
|
|
70
|
+
onExecuteListener?: (message: FastEventMessage, returns: any[], listeners: (FastEventListener<any, any, any> | [FastEventListener<any, any>, number])[]) => void;
|
|
71
|
+
};
|
|
72
|
+
type FastEvents = Record<string, any>;
|
|
73
|
+
type ScopeEvents<T extends Record<string, any>, Prefix extends string> = {
|
|
74
|
+
[K in keyof T as K extends `${Prefix}/${infer Rest}` ? Rest : never]: T[K];
|
|
75
|
+
};
|
|
76
|
+
type FastEventListenOptions = {
|
|
77
|
+
count?: number;
|
|
78
|
+
prepend?: boolean;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare class FastEventScope<Events extends FastEvents = FastEvents, Meta extends Record<string, any> = Record<string, any>, Types extends keyof Events = keyof Events> {
|
|
82
|
+
emitter: FastEvent<Events, Meta, Types>;
|
|
83
|
+
prefix: string;
|
|
84
|
+
constructor(emitter: FastEvent<Events, Meta, Types>, prefix: string);
|
|
85
|
+
private _getScopeListener;
|
|
86
|
+
private _getScopeType;
|
|
87
|
+
private _fixScopeType;
|
|
88
|
+
on<T extends Types = Types>(type: T, listener: FastEventListener<T, Events[T], Meta>, options?: FastEventListenOptions): FastEventSubscriber;
|
|
89
|
+
on<T extends string>(type: T, listener: FastEventListener<T, Events[T], Meta>, options?: FastEventListenOptions): FastEventSubscriber;
|
|
90
|
+
on(type: '**', listener: FastEventListener<any, any, Meta>): FastEventSubscriber;
|
|
91
|
+
once<T extends string>(type: T, listener: FastEventListener<T, Events[T], Meta>, options?: FastEventListenOptions): FastEventSubscriber;
|
|
92
|
+
once<T extends Types = Types>(type: T, listener: FastEventListener<Types, Events[T], Meta>, options?: FastEventListenOptions): FastEventSubscriber;
|
|
93
|
+
onAny<P = any>(listener: FastEventListener<Types, P, Meta>, options?: FastEventListenOptions): FastEventSubscriber;
|
|
94
|
+
offAll(): void;
|
|
95
|
+
off(listener: FastEventListener<any, any, any>): void;
|
|
96
|
+
off(type: string, listener: FastEventListener<any, any, any>): void;
|
|
97
|
+
off(type: Types, listener: FastEventListener<any, any, any>): void;
|
|
98
|
+
off(type: string): void;
|
|
99
|
+
off(type: Types): void;
|
|
100
|
+
clear(): void;
|
|
101
|
+
emit<R = any>(type: Types, payload?: Events[Types], retain?: boolean): R[];
|
|
102
|
+
emit<R = any>(type: string, payload?: any, retain?: boolean): R[];
|
|
103
|
+
waitFor<T extends Types, P = Events[T], M = Meta>(type: T, timeout?: number): Promise<FastEventMessage<T, P, M>>;
|
|
104
|
+
waitFor<T extends string, P = Events[T], M = Meta>(type: string, timeout?: number): Promise<FastEventMessage<T, P, M>>;
|
|
105
|
+
scope(prefix: string): FastEventScope<ScopeEvents<Events, string>, Record<string, any>, keyof ScopeEvents<Events, string>>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare class FastEvent<Events extends FastEvents = FastEvents, Meta extends Record<string, any> = Record<string, any>, Types extends keyof Events = keyof Events> {
|
|
109
|
+
listeners: FastListeners;
|
|
110
|
+
private _options;
|
|
111
|
+
private _delimiter;
|
|
112
|
+
private _context;
|
|
113
|
+
retainedMessages: Map<string, any>;
|
|
114
|
+
listenerCount: number;
|
|
115
|
+
constructor(options?: FastEventOptions<Meta>);
|
|
116
|
+
get options(): FastEventOptions;
|
|
117
|
+
get id(): string;
|
|
118
|
+
private _addListener;
|
|
119
|
+
private _enableDevTools;
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
* 根据parts路径遍历侦听器树,并在最后的节点上执行回调函数
|
|
123
|
+
*
|
|
124
|
+
* @param parts
|
|
125
|
+
* @param callback
|
|
126
|
+
* @returns
|
|
127
|
+
*/
|
|
128
|
+
private _forEachNodes;
|
|
129
|
+
/**
|
|
130
|
+
* 从监听器节点中移除指定的事件监听器
|
|
131
|
+
* @private
|
|
132
|
+
* @param node - 监听器节点
|
|
133
|
+
* @param listener - 需要移除的事件监听器
|
|
134
|
+
* @description 遍历节点的监听器列表,移除所有匹配的监听器。支持移除普通函数和数组形式的监听器
|
|
135
|
+
*/
|
|
136
|
+
private _removeListener;
|
|
137
|
+
on<T extends string>(type: T, listener: FastEventListener<T, Events[T], Meta>, options?: FastEventListenOptions): FastEventSubscriber;
|
|
138
|
+
on<T extends Types = Types>(type: T, listener: FastEventListener<Types, Events[T], Meta>, options?: FastEventListenOptions): FastEventSubscriber;
|
|
139
|
+
on<P = any>(type: '**', listener: FastEventListener<Types, P, Meta>): FastEventSubscriber;
|
|
140
|
+
once<T extends Types = Types>(type: T, listener: FastEventListener<T, Events[T], Meta>): FastEventSubscriber;
|
|
141
|
+
once<T extends string>(type: T, listener: FastEventListener<T, Events[T], Meta>): FastEventSubscriber;
|
|
142
|
+
/**
|
|
143
|
+
* 注册一个监听器,用于监听所有事件
|
|
144
|
+
* @param listener 事件监听器函数,可以接收任意类型的事件数据
|
|
145
|
+
* @returns {FastEventSubscriber} 返回一个订阅者对象,包含 off 方法用于取消监听
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* const subscriber = emitter.onAny((eventName, data) => {
|
|
149
|
+
* console.log(eventName, data);
|
|
150
|
+
* });
|
|
151
|
+
*
|
|
152
|
+
* // 取消监听
|
|
153
|
+
* subscriber.off();
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
onAny<P = any>(listener: FastEventListener<string, P, Meta>, options?: Pick<FastEventListenOptions, 'prepend'>): FastEventSubscriber;
|
|
157
|
+
off(listener: FastEventListener<any, any, any>): void;
|
|
158
|
+
off(type: string, listener: FastEventListener<any, any, any>): void;
|
|
159
|
+
off(type: Types, listener: FastEventListener<any, any, any>): void;
|
|
160
|
+
off(type: string): void;
|
|
161
|
+
off(type: Types): void;
|
|
162
|
+
/**
|
|
163
|
+
* 移除所有事件监听器
|
|
164
|
+
* @param entry - 可选的事件前缀,如果提供则只移除指定前缀下的的监听器
|
|
165
|
+
* @description
|
|
166
|
+
* - 如果提供了prefix参数,则只清除该前缀下的所有监听器
|
|
167
|
+
* - 如果没有提供prefix,则清除所有监听器
|
|
168
|
+
* - 同时会清空保留的事件(_retainedEvents)
|
|
169
|
+
* - 重置监听器对象为空
|
|
170
|
+
|
|
171
|
+
* @example
|
|
172
|
+
*
|
|
173
|
+
* ```ts
|
|
174
|
+
* emitter.offAll(); // 清除所有监听器
|
|
175
|
+
* emitter.offAll('a/b'); // 清除a/b下的所有监听器
|
|
176
|
+
*
|
|
177
|
+
*/
|
|
178
|
+
offAll(entry?: string): void;
|
|
179
|
+
private _getListenerNode;
|
|
180
|
+
/**
|
|
181
|
+
* 移除保留的事件
|
|
182
|
+
* @param prefix - 事件前缀。如果不提供,将清除所有保留的事件。
|
|
183
|
+
* 如果提供前缀,将删除所有以该前缀开头的事件。
|
|
184
|
+
* 如果前缀不以分隔符结尾,会自动添加分隔符。
|
|
185
|
+
* @private
|
|
186
|
+
*/
|
|
187
|
+
private _removeRetainedEvents;
|
|
188
|
+
clear(): void;
|
|
189
|
+
private _createMeta;
|
|
190
|
+
private _emitForLastEvent;
|
|
191
|
+
/**
|
|
192
|
+
* 遍历监听器节点树
|
|
193
|
+
* @param node 当前遍历的监听器节点
|
|
194
|
+
* @param parts 事件名称按'.'分割的部分数组
|
|
195
|
+
* @param callback 遍历到目标节点时的回调函数
|
|
196
|
+
* @param index 当前遍历的parts数组索引,默认为0
|
|
197
|
+
* @param lastFollowing 当命中**时该值为true, 注意**只能作在路径的最后面,如a.**有效,而a.**.b无效
|
|
198
|
+
* @private
|
|
199
|
+
*
|
|
200
|
+
* 支持三种匹配模式:
|
|
201
|
+
* - 精确匹配: 'a.b.c'
|
|
202
|
+
* - 单层通配: 'a.*.c'
|
|
203
|
+
* - 多层通配: 'a.**'
|
|
204
|
+
*/
|
|
205
|
+
private _traverseToPath;
|
|
206
|
+
private _traverseListeners;
|
|
207
|
+
private _executeListener;
|
|
208
|
+
/**
|
|
209
|
+
* 执行监听器节点中的所有监听函数
|
|
210
|
+
* @param node - FastListenerNode类型的监听器节点
|
|
211
|
+
* @param payload - 事件携带的数据
|
|
212
|
+
* @param type - 事件类型
|
|
213
|
+
* @returns 返回所有监听函数的执行结果数组
|
|
214
|
+
* @private
|
|
215
|
+
*
|
|
216
|
+
* @description
|
|
217
|
+
* 遍历执行节点中的所有监听函数:
|
|
218
|
+
* - 对于普通监听器,直接执行并收集结果
|
|
219
|
+
* - 对于带次数限制的监听器(数组形式),执行后递减次数,当次数为0时移除该监听器
|
|
220
|
+
*/
|
|
221
|
+
private _executeListeners;
|
|
222
|
+
/**
|
|
223
|
+
* 触发事件并执行对应的监听器
|
|
224
|
+
*
|
|
225
|
+
* @param type - 事件类型字符串或包含事件信息的对象
|
|
226
|
+
* @param payload - 事件携带的数据负载
|
|
227
|
+
* @param retain - 是否保留该事件(用于新订阅者)
|
|
228
|
+
* @param meta - 事件元数据
|
|
229
|
+
* @returns 所有监听器的执行结果数组
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* // 方式1: 参数形式
|
|
233
|
+
* emit('user.login', { id: 1 }, true)
|
|
234
|
+
*
|
|
235
|
+
* // 方式2: 对象形式
|
|
236
|
+
* emit({ type: 'user.login', payload: { id: 1 } ,meta:{...}}}, true)
|
|
237
|
+
*/
|
|
238
|
+
emit<R = any>(type: string, payload?: any, retain?: boolean, meta?: Meta): R[];
|
|
239
|
+
emit<R = any>(type: Types, payload?: Events[Types], retain?: boolean, meta?: Meta): R[];
|
|
240
|
+
emit<R = any>(message: FastEventMessage<Types, Events[Types], Meta>, retain?: boolean): R[];
|
|
241
|
+
emit<R = any>(message: FastEventMessage<string, any, Meta>, retain?: boolean): R[];
|
|
242
|
+
emitAsync<R = any>(type: string, payload?: any, retain?: boolean, meta?: Meta): Promise<[R | Error][]>;
|
|
243
|
+
emitAsync<R = any>(type: Types, payload?: Events[Types], retain?: boolean, meta?: Meta): Promise<[R | Error][]>;
|
|
244
|
+
/**
|
|
245
|
+
* 等待指定事件发生
|
|
246
|
+
*
|
|
247
|
+
* waitFor("x")
|
|
248
|
+
*
|
|
249
|
+
* @param type
|
|
250
|
+
* @param timeout 超时时间,单位毫秒,默认为 0,表示无限等待
|
|
251
|
+
*/
|
|
252
|
+
waitFor<T extends Types, P = Events[T], M = Meta>(type: T, timeout?: number): Promise<FastEventMessage<T, P, M>>;
|
|
253
|
+
waitFor<T extends string, P = Events[T], M = Meta>(type: string, timeout?: number): Promise<FastEventMessage<T, P, M>>;
|
|
254
|
+
/**
|
|
255
|
+
* 创建事件域
|
|
256
|
+
*
|
|
257
|
+
* 注意:
|
|
258
|
+
*
|
|
259
|
+
* 事件域与当前事件对象共享相同的侦听器表
|
|
260
|
+
* 也就是说,如果在事件域中触发事件,当前事件对象也会触发该事件
|
|
261
|
+
* 两者工不是完全隔离的,仅是事件侦听和触发时的事件类型不同而已
|
|
262
|
+
*
|
|
263
|
+
* const emitter = new FastEvent()
|
|
264
|
+
*
|
|
265
|
+
* const scope= emitter.scope("a/b")
|
|
266
|
+
*
|
|
267
|
+
* scope.on("x",()=>{}) == emitter.on("a/b/x",()=>{})
|
|
268
|
+
* scope.emit("x",1) == emitter.emit("a/b/x",1)
|
|
269
|
+
* scope.offAll() == emitter.offAll("a/b")
|
|
270
|
+
*
|
|
271
|
+
*/
|
|
272
|
+
scope<T extends string>(prefix: T): FastEventScope<ScopeEvents<Events, T>, Record<string, any>, keyof ScopeEvents<Events, T>>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
*
|
|
277
|
+
* 基于开发工具
|
|
278
|
+
*
|
|
279
|
+
* Redux DevTools 是一个实用工具,用于开发和调试 Redux 应用程序。
|
|
280
|
+
* FLEXEVENT是基于Redux DevTools 的简单包装,可以让开发者使用Redux DevTools
|
|
281
|
+
* 来查看FLEXEVENT的状态变化
|
|
282
|
+
*
|
|
283
|
+
* import { createStore } from "@FLEXEVENTjs/react"
|
|
284
|
+
* import { install } from "@FLEXEVENTjs/devtools"
|
|
285
|
+
*
|
|
286
|
+
*
|
|
287
|
+
* const store = createStore({})
|
|
288
|
+
*
|
|
289
|
+
* install()
|
|
290
|
+
*
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
declare class FlexEventDevTools {
|
|
294
|
+
private reduxStore;
|
|
295
|
+
private _installed;
|
|
296
|
+
fastEvents: WeakObjectMap<object>;
|
|
297
|
+
constructor();
|
|
298
|
+
add(instance: FastEvent): void;
|
|
299
|
+
remove(instance: FastEvent): void;
|
|
300
|
+
private reducer;
|
|
301
|
+
private install;
|
|
302
|
+
}
|
|
303
|
+
declare function install(): void;
|
|
304
|
+
declare global {
|
|
305
|
+
var __FLEXEVENT_DEVTOOLS__: FlexEventDevTools;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export { FlexEventDevTools, install };
|
package/dist/devTools.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var x=Object.defineProperty;var j=(r,e,t)=>e in r?x(r,e,{enumerable:true,configurable:true,writable:true,value:t}):r[e]=t;var n=(r,e)=>x(r,"name",{value:e,configurable:true});var h=(r,e,t)=>j(r,typeof e!="symbol"?e+"":e,t);function u(r){return `Minified Redux error #${r}; visit https://redux.js.org/Errors?code=${r} for the full message or use the non-minified dev environment for full errors. `}n(u,"formatProdErrorMessage");var L=typeof Symbol=="function"&&Symbol.observable||"@@observable",D=L,w=n(()=>Math.random().toString(36).substring(7).split("").join("."),"randomString"),C={INIT:`@@redux/INIT${w()}`,REPLACE:`@@redux/REPLACE${w()}`,PROBE_UNKNOWN_ACTION:n(()=>`@@redux/PROBE_UNKNOWN_ACTION${w()}`,"PROBE_UNKNOWN_ACTION")},T=C;function M(r){if(typeof r!="object"||r===null)return false;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e||Object.getPrototypeOf(r)===null}n(M,"isPlainObject");function P(r){if(r===void 0)return "undefined";if(r===null)return "null";let e=typeof r;switch(e){case "boolean":case "string":case "number":case "symbol":case "function":return e}if(Array.isArray(r))return "array";if(F(r))return "date";if(U(r))return "error";let t=K(r);switch(t){case "Symbol":case "Promise":case "WeakMap":case "WeakSet":case "Map":case "Set":return t}return Object.prototype.toString.call(r).slice(8,-1).toLowerCase().replace(/\s/g,"")}n(P,"miniKindOf");function K(r){return typeof r.constructor=="function"?r.constructor.name:null}n(K,"ctorName");function U(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}n(U,"isError");function F(r){return r instanceof Date?true:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}n(F,"isDate");function y(r){let e=typeof r;return process.env.NODE_ENV!=="production"&&(e=P(r)),e}n(y,"kindOf");function R(r,e,t){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?u(2):`Expected the root reducer to be a function. Instead, received: '${y(r)}'`);if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?u(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?u(1):`Expected the enhancer to be a function. Instead, received: '${y(t)}'`);return t(R)(r,e)}let i=r,o=e,p=new Map,d=p,c=0,f=false;function E(){d===p&&(d=new Map,p.forEach((s,a)=>{d.set(a,s);}));}n(E,"ensureCanMutateNextListeners");function O(){if(f)throw new Error(process.env.NODE_ENV==="production"?u(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}n(O,"getState");function S(s){if(typeof s!="function")throw new Error(process.env.NODE_ENV==="production"?u(4):`Expected the listener to be a function. Instead, received: '${y(s)}'`);if(f)throw new Error(process.env.NODE_ENV==="production"?u(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let a=true;E();let l=c++;return d.set(l,s),n(function(){if(a){if(f)throw new Error(process.env.NODE_ENV==="production"?u(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");a=false,E(),d.delete(l),p=null;}},"unsubscribe")}n(S,"subscribe");function m(s){if(!M(s))throw new Error(process.env.NODE_ENV==="production"?u(7):`Actions must be plain objects. Instead, the actual type was: '${y(s)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof s.type>"u")throw new Error(process.env.NODE_ENV==="production"?u(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof s.type!="string")throw new Error(process.env.NODE_ENV==="production"?u(17):`Action "type" property must be a string. Instead, the actual type was: '${y(s.type)}'. Value was: '${s.type}' (stringified)`);if(f)throw new Error(process.env.NODE_ENV==="production"?u(9):"Reducers may not dispatch actions.");try{f=!0,o=i(o,s);}finally{f=false;}return (p=d).forEach(l=>{l();}),s}n(m,"dispatch");function A(s){if(typeof s!="function")throw new Error(process.env.NODE_ENV==="production"?u(10):`Expected the nextReducer to be a function. Instead, received: '${y(s)}`);i=s,m({type:T.REPLACE});}n(A,"replaceReducer");function k(){let s=S;return {subscribe(a){if(typeof a!="object"||a===null)throw new Error(process.env.NODE_ENV==="production"?u(11):`Expected the observer to be an object. Instead, received: '${y(a)}'`);function l(){let I=a;I.next&&I.next(O());}return n(l,"observeState"),l(),{unsubscribe:s(l)}},[D](){return this}}}return n(k,"observable"),m({type:T.INIT}),{dispatch:m,subscribe:S,getState:O,replaceReducer:A,[D]:k}}n(R,"createStore");function V(r,e,t){return R(r,e,t)}n(V,"legacy_createStore");var g=class g{constructor(){h(this,"map");h(this,"finalizationRegistry");this.map=new Map,this.finalizationRegistry=new FinalizationRegistry(e=>{this.map.delete(e);});}set(e,t){let i=new WeakRef(t);this.map.set(e,i),this.finalizationRegistry.register(t,e);}get(e){let t=this.map.get(e);return t?t.deref():void 0}delete(e){return this.map.delete(e)}has(e){let t=this.map.get(e);return t?t.deref()!==void 0:false}};n(g,"WeakObjectMap");var _=g;var W={};function b(r){return {messageCount:0,listenerCount:r.listenerCount,retainMessageCount:r.retainedMessages.size}}n(b,"getDefaultFastEventState");var v=class v{constructor(){h(this,"reduxStore");h(this,"_installed",false);h(this,"fastEvents",new _);this.install();}add(e){this.fastEvents.set(e.id,e),e.options.onAddListener=(t,i)=>{this.reduxStore.dispatch({type:"__ADD_LISTENER__",event:t.join("/"),listener:i,fastEventId:e.id});},e.options.onRemoveListener=(t,i)=>{this.reduxStore.dispatch({type:"__REMOVE_LISTENER__",event:t.join("/"),listener:i,fastEventId:e.id});},e.options.onClearListeners=()=>{this.reduxStore.dispatch({type:"__CLEAR_LISTENERS__",fastEventId:e.id});},e.options.onExecuteListener=(t,i,o)=>{let p=i.map(c=>c instanceof Error?`Error(${c.message})`:c),d=o.map(c=>c.name||"anonymous").reduce((c,f,E)=>(c[f]=p[E],c),{});console.log(`FastEvent<\x1B[31m${t.type}<\x1B[30m> is emit, listeners:`,o),this.reduxStore.dispatch({type:t.type,payload:t.payload,meta:t.meta,returns:d,fastEventId:e.id});},this.reduxStore.dispatch({type:"__ADD_FASTEVENT__",fastEventId:e.id});}remove(e){this.fastEvents.has(e.id)&&this.fastEvents.delete(e.id);}reducer(e=W,t){if(t.type.startsWith("@@"))return e;let i=this.fastEvents.get(t.fastEventId);if(t.type==="__ADD_FASTEVENT__")return {...e,[t.fastEventId]:b(i)};if(t.type=="__ADD_LISTENER__"){let o=e[t.fastEventId]||b(i);return o.listenerCount++,{...e,[t.fastEventId]:{...o}}}else if(t.type=="__REMOVE_LISTENER__"){let o=e[t.fastEventId];return o?(o.listenerCount++,{...e,[t.fastEventId]:{...o}}):e}else if(t.type==="__CLEAR_LISTENERS__"){let o=e[t.fastEventId];return o?(o.listenerCount++,{...e,[t.fastEventId]:b(i)}):e}else {let o=e[t.fastEventId];return o?(o.messageCount++,o.listenerCount=i.listenerCount,o.retainMessageCount=i.retainedMessages.size,{...e,[t.fastEventId]:{...o}}):e}}install(){this._installed||(this.reduxStore=V(this.reducer.bind(this),window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__()),this._installed=true,console.info("%c FlexEventDevTools installed. Please open <Redux devtools> to view. %c","color:red;",""));}};n(v,"FlexEventDevTools");var N=v;function z(){globalThis.__FLEXEVENT_DEVTOOLS__||(globalThis.__FLEXEVENT_DEVTOOLS__=new N);}n(z,"install");z();
|
|
2
|
+
exports.FlexEventDevTools=N;exports.install=z;//# sourceMappingURL=devTools.js.map
|
|
3
|
+
//# sourceMappingURL=devTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/formatProdErrorMessage.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/symbol-observable.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/actionTypes.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/isPlainObject.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/kindOf.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/createStore.ts","../src/utils/WeakObjectMap.ts","../src/devTools.ts"],"names":["formatProdErrorMessage","code","__name","$$observable","symbol_observable_default","randomString","ActionTypes","actionTypes_default","isPlainObject","obj","proto","miniKindOf","val","type","isDate","isError","constructorName","ctorName","kindOf","typeOfVal","createStore","reducer","preloadedState","enhancer","currentReducer","currentState","currentListeners","nextListeners","listenerIdCounter","isDispatching","ensureCanMutateNextListeners","listener","key","getState","subscribe","isSubscribed","listenerId","dispatch","action","replaceReducer","nextReducer","observable","outerSubscribe","observer","observeState","observerAsObserver","legacy_createStore","WeakObjectMap","constructor","map","finalizationRegistry","Map","FinalizationRegistry","delete","set","value","weakRef","WeakRef","register","get","deref","undefined","has","_WeakObjectMap","initialState","getDefaultFastEventState","instance","messageCount","listenerCount","retainMessageCount","retainedMessages","size","FlexEventDevTools","reduxStore","_installed","fastEvents","install","add","id","options","onAddListener","event","join","fastEventId","onRemoveListener","onClearListeners","onExecuteListener","message","returns","listeners","results","r","Error","sresults","name","reduce","pre","cur","index","console","log","payload","meta","remove","state","startsWith","eventState","bind","window","__REDUX_DEVTOOLS_EXTENSION__","info","_FlexEventDevTools","globalThis","__FLEXEVENT_DEVTOOLS__"],"mappings":"aAOO,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAA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AA,CAAiBC,KACnD,CACH,GAAGiC,CACH,CAAA,CAAClE,EAAO6C,WAAW,EAAG,CAAE,GAAGuB,CAAW,CAC1C,CAAA,EAPwBF,CAQ5B,CACJ,CACQ5B,OAAU,EAAA,CACV,KAAKF,UACT,GAAA,IAAA,CAAKD,WAAarD,CACd,CAAA,IAAA,CAAKC,OAAQsF,CAAAA,IAAAA,CAAK,IAAI,CAEtBC,CAAAA,MAAAA,CAAOC,4BAAgCD,EAAAA,MAAAA,CAAOC,8BAA4B,CAAA,CAE9E,IAAKnC,CAAAA,UAAAA,CAAa,KAClByB,OAAQW,CAAAA,IAAAA,CAAK,2EAA4E,YAAc,CAAA,EAAA,GAC3G,CACJ,CAAA,CAnHatC,CAAAA,CAAAA,CAAAA,CAAAA,qBAAAA,IAAAA,CAAAA,CAANuC,EAqHA,SAASnC,GAAAA,CAEPoC,UAAAA,CAAWC,sBAAwBD,GAAAA,UAAAA,CAAWC,uBAAyB,IAAIzC,CAAAA,EACpF,CAHgBI,CAAAA,CAAAA,CAAAA,CAAAA,WAWhBA,CAAAA,EAAAA","file":"devTools.js","sourcesContent":["/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nexport function formatProdErrorMessage(code: number) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or ` + 'use the non-minified dev environment for full errors. ';\n}","declare global {\n interface SymbolConstructor {\n readonly observable: symbol;\n }\n}\nconst $$observable = /* #__PURE__ */(() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();\nexport default $$observable;","/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\n\nconst randomString = () => Math.random().toString(36).substring(7).split('').join('.');\nconst ActionTypes = {\n INIT: `@@redux/INIT${/* #__PURE__ */randomString()}`,\n REPLACE: `@@redux/REPLACE${/* #__PURE__ */randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nexport default ActionTypes;","/**\n * @param obj The object to inspect.\n * @returns True if the argument appears to be a plain object.\n */\nexport default function isPlainObject(obj: any): obj is object {\n if (typeof obj !== 'object' || obj === null) return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}","// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nexport function miniKindOf(val: any): string {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n const type = typeof val;\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n const constructorName = ctorName(val);\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n }\n\n // other\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\nfunction ctorName(val: any): string | null {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\nfunction isError(val: any) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\nfunction isDate(val: any) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\nexport function kindOf(val: any) {\n let typeOfVal: string = typeof val;\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}","import { formatProdErrorMessage as _formatProdErrorMessage13 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage12 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage11 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage10 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage9 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage8 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage7 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage6 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage5 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage4 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage3 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport $$observable from './utils/symbol-observable';\nimport { Store, StoreEnhancer, Dispatch, Observer, ListenerCallback, UnknownIfNonSpecific } from './types/store';\nimport { Action } from './types/actions';\nimport { Reducer } from './types/reducers';\nimport ActionTypes from './utils/actionTypes';\nimport isPlainObject from './utils/isPlainObject';\nimport { kindOf } from './utils/kindOf';\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | StoreEnhancer<Ext, StateExt> | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = (preloadedState as StoreEnhancer<Ext, StateExt>);\n preloadedState = undefined;\n }\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, (preloadedState as PreloadedState | undefined));\n }\n let currentReducer = reducer;\n let currentState: S | PreloadedState | undefined = (preloadedState as PreloadedState | undefined);\n let currentListeners: Map<number, ListenerCallback> | null = new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns The current state tree of your application.\n */\n function getState(): S {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n return (currentState as S);\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param listener A callback to be invoked on every dispatch.\n * @returns A function to remove this change listener.\n */\n function subscribe(listener: () => void) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage5(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage6(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage7(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action: A) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage8(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage9(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== 'string') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage10(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage11(9) : 'Reducers may not dispatch actions.');\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach(listener => {\n listener();\n });\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param nextReducer The reducer for the store to use instead.\n */\n function replaceReducer(nextReducer: Reducer<S, A>): void {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage12(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = ((nextReducer as unknown) as Reducer<S, A, PreloadedState>);\n\n // This action has a similar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n dispatch(({\n type: ActionTypes.REPLACE\n } as A));\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer: unknown) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage13(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = (observer as Observer<S>);\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [$$observable]() {\n return this;\n }\n };\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch(({\n type: ActionTypes.INIT\n } as A));\n const store = (({\n dispatch: (dispatch as Dispatch<A>),\n subscribe,\n getState,\n replaceReducer,\n [$$observable]: observable\n } as unknown) as Store<S, A, StateExt> & Ext);\n return store;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A>, preloadedState?: PreloadedState | StoreEnhancer<Ext, StateExt> | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {\n return createStore(reducer, (preloadedState as any), enhancer);\n}","/**\n * 一个基于弱引用(WeakRef)的键值映射集合\n * \n * @template T - 值的类型,必须是对象类型(继承自 `object`)\n * \n * @example\n * const map = new WeakObjectMap<MyObject>();\n * map.set('key1', obj1);\n * const retrieved = map.get('key1'); // 返回 obj1 或 undefined(如果已被垃圾回收)\n */\nexport class WeakObjectMap<T extends object> {\n private map: Map<string, WeakRef<T>>;\n private finalizationRegistry: FinalizationRegistry<string>;\n \n /**\n * 构造一个新的 WeakObjectMap 实例\n */\n constructor() {\n this.map = new Map();\n this.finalizationRegistry = new FinalizationRegistry((key) => {\n this.map.delete(key);\n });\n }\n \n /**\n * 设置键值对\n * @param key - 字符串键名\n * @param value - 要存储的对象值(会被自动包装为弱引用)\n */\n set(key: string, value: T): void {\n const weakRef = new WeakRef(value);\n this.map.set(key, weakRef);\n this.finalizationRegistry.register(value, key);\n }\n \n /**\n * 获取指定键对应的值\n * @param key - 要查找的键名\n * @returns 如果值存在且未被垃圾回收则返回值,否则返回 undefined\n */\n get(key: string): T | undefined {\n const weakRef = this.map.get(key);\n return weakRef ? weakRef.deref() : undefined;\n }\n \n /**\n * 删除指定键的映射\n * @param key - 要删除的键名\n * @returns 如果键存在并已删除则返回 true,否则返回 false\n */\n delete(key: string): boolean {\n return this.map.delete(key);\n }\n \n /**\n * 检查是否存在指定键的映射(且值未被垃圾回收)\n * @param key - 要检查的键名\n * @returns 如果键存在且值未被回收则返回 true,否则返回 false\n */\n has(key: string): boolean {\n const weakRef = this.map.get(key);\n return weakRef ? weakRef.deref() !== undefined : false;\n }\n}\n","/**\n * \n * 基于开发工具\n * \n * Redux DevTools 是一个实用工具,用于开发和调试 Redux 应用程序。\n * FLEXEVENT是基于Redux DevTools 的简单包装,可以让开发者使用Redux DevTools\n * 来查看FLEXEVENT的状态变化 \n * \n * import { createStore } from \"@FLEXEVENTjs/react\"\n * import { install } from \"@FLEXEVENTjs/devtools\"\n * \n * \n * const store = createStore({})\n * \n * install()\n * \n */\n\n//@ts-ignore\nimport { legacy_createStore as createStore } from \"redux\"\nimport { WeakObjectMap } from \"./utils/WeakObjectMap\"\nimport { FastEvent } from \"./event\"\n\nconst initialState = {\n\n}\n\n\nfunction getDefaultFastEventState(instance: FastEvent) {\n return {\n messageCount: 0,\n listenerCount: instance.listenerCount,\n retainMessageCount: instance.retainedMessages.size,\n }\n}\n\nexport class FlexEventDevTools {\n private reduxStore: any\n private _installed: boolean = false\n fastEvents = new WeakObjectMap()\n constructor() {\n this.install()\n }\n add(instance: FastEvent) {\n this.fastEvents.set(instance.id, instance)\n\n instance.options.onAddListener = (type: string[], listener: any) => {\n this.reduxStore.dispatch({\n type: \"__ADD_LISTENER__\",\n event: type.join(\"/\"),\n listener,\n fastEventId: instance.id\n })\n }\n instance.options.onRemoveListener = (type: string[], listener: any) => {\n this.reduxStore.dispatch({\n type: \"__REMOVE_LISTENER__\",\n event: type.join(\"/\"),\n listener,\n fastEventId: instance.id\n })\n }\n instance.options.onClearListeners = () => {\n this.reduxStore.dispatch({\n type: \"__CLEAR_LISTENERS__\",\n fastEventId: instance.id\n })\n }\n instance.options.onExecuteListener = (message, returns, listeners) => {\n const results = returns.map(r => r instanceof Error ? `Error(${r.message})` : r)\n const sresults = listeners.map(listener => (listener as any).name || 'anonymous')\n .reduce((pre, cur, index) => {\n pre[cur] = results[index]\n return pre\n }, {})\n console.log(`FastEvent<\\x1B[31m${message.type}<\\x1B[30m> is emit, listeners:`, listeners)\n this.reduxStore.dispatch({\n type: message.type,\n payload: message.payload,\n meta: message.meta,\n returns: sresults,\n fastEventId: instance.id\n })\n }\n this.reduxStore.dispatch({\n type: \"__ADD_FASTEVENT__\",\n fastEventId: instance.id\n })\n }\n remove(instance: FastEvent) {\n if (this.fastEvents.has(instance.id)) {\n this.fastEvents.delete(instance.id)\n }\n }\n private reducer(state: any = initialState, action: any) {\n if (action.type.startsWith(\"@@\")) return state\n const instance = this.fastEvents.get(action.fastEventId) as FastEvent\n if (action.type === '__ADD_FASTEVENT__') {\n return {\n ...state,\n [action.fastEventId]: getDefaultFastEventState(instance)\n }\n } else if (action.type == '__ADD_LISTENER__') {\n const eventState = state[action.fastEventId] || getDefaultFastEventState(instance)\n eventState.listenerCount++\n return {\n ...state,\n [action.fastEventId]: {\n ...eventState\n }\n }\n } else if (action.type == '__REMOVE_LISTENER__') {\n const eventState = state[action.fastEventId]\n if (!eventState) return state\n eventState.listenerCount++\n return {\n ...state,\n [action.fastEventId]: {\n ...eventState\n }\n }\n } else if (action.type === '__CLEAR_LISTENERS__') {\n const eventState = state[action.fastEventId]\n if (!eventState) return state\n eventState.listenerCount++\n return {\n ...state,\n [action.fastEventId]: getDefaultFastEventState(instance)\n }\n } else {\n const eventState = state[action.fastEventId]\n if (!eventState) return state\n eventState.messageCount++\n eventState.listenerCount = instance.listenerCount\n eventState.retainMessageCount = instance.retainedMessages.size\n return {\n ...state,\n [action.fastEventId]: { ...eventState }\n }\n }\n }\n private install() {\n if (this._installed) return\n this.reduxStore = createStore(\n this.reducer.bind(this),\n // @ts-ignore\n window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()\n );\n this._installed = true\n console.info('%c FlexEventDevTools installed. Please open <Redux devtools> to view. %c', \"color:red;\", '')\n }\n}\n\nexport function install() {\n // @ts-ignore\n if (!globalThis.__FLEXEVENT_DEVTOOLS__) globalThis.__FLEXEVENT_DEVTOOLS__ = new FlexEventDevTools()\n}\n\ndeclare global {\n // @ts-ignore\n var __FLEXEVENT_DEVTOOLS__: FlexEventDevTools\n}\n\n\ninstall()\n\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var x=Object.defineProperty;var j=(r,e,t)=>e in r?x(r,e,{enumerable:true,configurable:true,writable:true,value:t}):r[e]=t;var n=(r,e)=>x(r,"name",{value:e,configurable:true});var h=(r,e,t)=>j(r,typeof e!="symbol"?e+"":e,t);function u(r){return `Minified Redux error #${r}; visit https://redux.js.org/Errors?code=${r} for the full message or use the non-minified dev environment for full errors. `}n(u,"formatProdErrorMessage");var L=typeof Symbol=="function"&&Symbol.observable||"@@observable",D=L,w=n(()=>Math.random().toString(36).substring(7).split("").join("."),"randomString"),C={INIT:`@@redux/INIT${w()}`,REPLACE:`@@redux/REPLACE${w()}`,PROBE_UNKNOWN_ACTION:n(()=>`@@redux/PROBE_UNKNOWN_ACTION${w()}`,"PROBE_UNKNOWN_ACTION")},T=C;function M(r){if(typeof r!="object"||r===null)return false;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e||Object.getPrototypeOf(r)===null}n(M,"isPlainObject");function P(r){if(r===void 0)return "undefined";if(r===null)return "null";let e=typeof r;switch(e){case "boolean":case "string":case "number":case "symbol":case "function":return e}if(Array.isArray(r))return "array";if(F(r))return "date";if(U(r))return "error";let t=K(r);switch(t){case "Symbol":case "Promise":case "WeakMap":case "WeakSet":case "Map":case "Set":return t}return Object.prototype.toString.call(r).slice(8,-1).toLowerCase().replace(/\s/g,"")}n(P,"miniKindOf");function K(r){return typeof r.constructor=="function"?r.constructor.name:null}n(K,"ctorName");function U(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}n(U,"isError");function F(r){return r instanceof Date?true:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}n(F,"isDate");function y(r){let e=typeof r;return process.env.NODE_ENV!=="production"&&(e=P(r)),e}n(y,"kindOf");function R(r,e,t){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?u(2):`Expected the root reducer to be a function. Instead, received: '${y(r)}'`);if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?u(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?u(1):`Expected the enhancer to be a function. Instead, received: '${y(t)}'`);return t(R)(r,e)}let i=r,o=e,p=new Map,d=p,c=0,f=false;function E(){d===p&&(d=new Map,p.forEach((s,a)=>{d.set(a,s);}));}n(E,"ensureCanMutateNextListeners");function O(){if(f)throw new Error(process.env.NODE_ENV==="production"?u(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}n(O,"getState");function S(s){if(typeof s!="function")throw new Error(process.env.NODE_ENV==="production"?u(4):`Expected the listener to be a function. Instead, received: '${y(s)}'`);if(f)throw new Error(process.env.NODE_ENV==="production"?u(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let a=true;E();let l=c++;return d.set(l,s),n(function(){if(a){if(f)throw new Error(process.env.NODE_ENV==="production"?u(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");a=false,E(),d.delete(l),p=null;}},"unsubscribe")}n(S,"subscribe");function m(s){if(!M(s))throw new Error(process.env.NODE_ENV==="production"?u(7):`Actions must be plain objects. Instead, the actual type was: '${y(s)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof s.type>"u")throw new Error(process.env.NODE_ENV==="production"?u(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof s.type!="string")throw new Error(process.env.NODE_ENV==="production"?u(17):`Action "type" property must be a string. Instead, the actual type was: '${y(s.type)}'. Value was: '${s.type}' (stringified)`);if(f)throw new Error(process.env.NODE_ENV==="production"?u(9):"Reducers may not dispatch actions.");try{f=!0,o=i(o,s);}finally{f=false;}return (p=d).forEach(l=>{l();}),s}n(m,"dispatch");function A(s){if(typeof s!="function")throw new Error(process.env.NODE_ENV==="production"?u(10):`Expected the nextReducer to be a function. Instead, received: '${y(s)}`);i=s,m({type:T.REPLACE});}n(A,"replaceReducer");function k(){let s=S;return {subscribe(a){if(typeof a!="object"||a===null)throw new Error(process.env.NODE_ENV==="production"?u(11):`Expected the observer to be an object. Instead, received: '${y(a)}'`);function l(){let I=a;I.next&&I.next(O());}return n(l,"observeState"),l(),{unsubscribe:s(l)}},[D](){return this}}}return n(k,"observable"),m({type:T.INIT}),{dispatch:m,subscribe:S,getState:O,replaceReducer:A,[D]:k}}n(R,"createStore");function V(r,e,t){return R(r,e,t)}n(V,"legacy_createStore");var g=class g{constructor(){h(this,"map");h(this,"finalizationRegistry");this.map=new Map,this.finalizationRegistry=new FinalizationRegistry(e=>{this.map.delete(e);});}set(e,t){let i=new WeakRef(t);this.map.set(e,i),this.finalizationRegistry.register(t,e);}get(e){let t=this.map.get(e);return t?t.deref():void 0}delete(e){return this.map.delete(e)}has(e){let t=this.map.get(e);return t?t.deref()!==void 0:false}};n(g,"WeakObjectMap");var _=g;var W={};function b(r){return {messageCount:0,listenerCount:r.listenerCount,retainMessageCount:r.retainedMessages.size}}n(b,"getDefaultFastEventState");var v=class v{constructor(){h(this,"reduxStore");h(this,"_installed",false);h(this,"fastEvents",new _);this.install();}add(e){this.fastEvents.set(e.id,e),e.options.onAddListener=(t,i)=>{this.reduxStore.dispatch({type:"__ADD_LISTENER__",event:t.join("/"),listener:i,fastEventId:e.id});},e.options.onRemoveListener=(t,i)=>{this.reduxStore.dispatch({type:"__REMOVE_LISTENER__",event:t.join("/"),listener:i,fastEventId:e.id});},e.options.onClearListeners=()=>{this.reduxStore.dispatch({type:"__CLEAR_LISTENERS__",fastEventId:e.id});},e.options.onExecuteListener=(t,i,o)=>{let p=i.map(c=>c instanceof Error?`Error(${c.message})`:c),d=o.map(c=>c.name||"anonymous").reduce((c,f,E)=>(c[f]=p[E],c),{});console.log(`FastEvent<\x1B[31m${t.type}<\x1B[30m> is emit, listeners:`,o),this.reduxStore.dispatch({type:t.type,payload:t.payload,meta:t.meta,returns:d,fastEventId:e.id});},this.reduxStore.dispatch({type:"__ADD_FASTEVENT__",fastEventId:e.id});}remove(e){this.fastEvents.has(e.id)&&this.fastEvents.delete(e.id);}reducer(e=W,t){if(t.type.startsWith("@@"))return e;let i=this.fastEvents.get(t.fastEventId);if(t.type==="__ADD_FASTEVENT__")return {...e,[t.fastEventId]:b(i)};if(t.type=="__ADD_LISTENER__"){let o=e[t.fastEventId]||b(i);return o.listenerCount++,{...e,[t.fastEventId]:{...o}}}else if(t.type=="__REMOVE_LISTENER__"){let o=e[t.fastEventId];return o?(o.listenerCount++,{...e,[t.fastEventId]:{...o}}):e}else if(t.type==="__CLEAR_LISTENERS__"){let o=e[t.fastEventId];return o?(o.listenerCount++,{...e,[t.fastEventId]:b(i)}):e}else {let o=e[t.fastEventId];return o?(o.messageCount++,o.listenerCount=i.listenerCount,o.retainMessageCount=i.retainedMessages.size,{...e,[t.fastEventId]:{...o}}):e}}install(){this._installed||(this.reduxStore=V(this.reducer.bind(this),window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__()),this._installed=true,console.info("%c FlexEventDevTools installed. Please open <Redux devtools> to view. %c","color:red;",""));}};n(v,"FlexEventDevTools");var N=v;function z(){globalThis.__FLEXEVENT_DEVTOOLS__||(globalThis.__FLEXEVENT_DEVTOOLS__=new N);}n(z,"install");z();
|
|
2
|
+
export{N as FlexEventDevTools,z as install};//# sourceMappingURL=devTools.mjs.map
|
|
3
|
+
//# sourceMappingURL=devTools.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/formatProdErrorMessage.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/symbol-observable.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/actionTypes.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/isPlainObject.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/utils/kindOf.ts","../node_modules/.pnpm/redux@5.0.1/node_modules/redux/src/createStore.ts","../src/utils/WeakObjectMap.ts","../src/devTools.ts"],"names":["formatProdErrorMessage","code","__name","$$observable","symbol_observable_default","randomString","ActionTypes","actionTypes_default","isPlainObject","obj","proto","miniKindOf","val","type","isDate","isError","constructorName","ctorName","kindOf","typeOfVal","createStore","reducer","preloadedState","enhancer","currentReducer","currentState","currentListeners","nextListeners","listenerIdCounter","isDispatching","ensureCanMutateNextListeners","listener","key","getState","subscribe","isSubscribed","listenerId","dispatch","action","replaceReducer","nextReducer","observable","outerSubscribe","observer","observeState","observerAsObserver","legacy_createStore","WeakObjectMap","constructor","map","finalizationRegistry","Map","FinalizationRegistry","delete","set","value","weakRef","WeakRef","register","get","deref","undefined","has","_WeakObjectMap","initialState","getDefaultFastEventState","instance","messageCount","listenerCount","retainMessageCount","retainedMessages","size","FlexEventDevTools","reduxStore","_installed","fastEvents","install","add","id","options","onAddListener","event","join","fastEventId","onRemoveListener","onClearListeners","onExecuteListener","message","returns","listeners","results","r","Error","sresults","name","reduce","pre","cur","index","console","log","payload","meta","remove","state","startsWith","eventState","bind","window","__REDUX_DEVTOOLS_EXTENSION__","info","_FlexEventDevTools","globalThis","__FLEXEVENT_DEVTOOLS__"],"mappings":"AAOO,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IA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E,aACpCsC,CAAAA,CAAAA,CAAWrC,mBAAqBH,CAASI,CAAAA,gBAAAA,CAAiBC,KACnD,CACH,GAAGiC,CACH,CAAA,CAAClE,EAAO6C,WAAW,EAAG,CAAE,GAAGuB,CAAW,CAC1C,CAAA,EAPwBF,CAQ5B,CACJ,CACQ5B,OAAU,EAAA,CACV,KAAKF,UACT,GAAA,IAAA,CAAKD,WAAarD,CACd,CAAA,IAAA,CAAKC,OAAQsF,CAAAA,IAAAA,CAAK,IAAI,CAEtBC,CAAAA,MAAAA,CAAOC,4BAAgCD,EAAAA,MAAAA,CAAOC,8BAA4B,CAAA,CAE9E,IAAKnC,CAAAA,UAAAA,CAAa,KAClByB,OAAQW,CAAAA,IAAAA,CAAK,2EAA4E,YAAc,CAAA,EAAA,GAC3G,CACJ,CAAA,CAnHatC,CAAAA,CAAAA,CAAAA,CAAAA,qBAAAA,IAAAA,CAAAA,CAANuC,EAqHA,SAASnC,GAAAA,CAEPoC,UAAAA,CAAWC,sBAAwBD,GAAAA,UAAAA,CAAWC,uBAAyB,IAAIzC,CAAAA,EACpF,CAHgBI,CAAAA,CAAAA,CAAAA,CAAAA,WAWhBA,CAAAA,EAAAA","file":"devTools.mjs","sourcesContent":["/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nexport function formatProdErrorMessage(code: number) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or ` + 'use the non-minified dev environment for full errors. ';\n}","declare global {\n interface SymbolConstructor {\n readonly observable: symbol;\n }\n}\nconst $$observable = /* #__PURE__ */(() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();\nexport default $$observable;","/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\n\nconst randomString = () => Math.random().toString(36).substring(7).split('').join('.');\nconst ActionTypes = {\n INIT: `@@redux/INIT${/* #__PURE__ */randomString()}`,\n REPLACE: `@@redux/REPLACE${/* #__PURE__ */randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nexport default ActionTypes;","/**\n * @param obj The object to inspect.\n * @returns True if the argument appears to be a plain object.\n */\nexport default function isPlainObject(obj: any): obj is object {\n if (typeof obj !== 'object' || obj === null) return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}","// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nexport function miniKindOf(val: any): string {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n const type = typeof val;\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n const constructorName = ctorName(val);\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n }\n\n // other\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\nfunction ctorName(val: any): string | null {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\nfunction isError(val: any) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\nfunction isDate(val: any) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\nexport function kindOf(val: any) {\n let typeOfVal: string = typeof val;\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}","import { formatProdErrorMessage as _formatProdErrorMessage13 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage12 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage11 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage10 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage9 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage8 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage7 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage6 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage5 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage4 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage3 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"src/utils/formatProdErrorMessage\";\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"src/utils/formatProdErrorMessage\";\nimport $$observable from './utils/symbol-observable';\nimport { Store, StoreEnhancer, Dispatch, Observer, ListenerCallback, UnknownIfNonSpecific } from './types/store';\nimport { Action } from './types/actions';\nimport { Reducer } from './types/reducers';\nimport ActionTypes from './utils/actionTypes';\nimport isPlainObject from './utils/isPlainObject';\nimport { kindOf } from './utils/kindOf';\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\nexport function createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | StoreEnhancer<Ext, StateExt> | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = (preloadedState as StoreEnhancer<Ext, StateExt>);\n preloadedState = undefined;\n }\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, (preloadedState as PreloadedState | undefined));\n }\n let currentReducer = reducer;\n let currentState: S | PreloadedState | undefined = (preloadedState as PreloadedState | undefined);\n let currentListeners: Map<number, ListenerCallback> | null = new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n\n /**\n * Reads the state tree managed by the store.\n *\n * @returns The current state tree of your application.\n */\n function getState(): S {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n return (currentState as S);\n }\n\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param listener A callback to be invoked on every dispatch.\n * @returns A function to remove this change listener.\n */\n function subscribe(listener: () => void) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage5(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage6(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage7(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n function dispatch(action: A) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage8(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage9(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== 'string') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage10(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage11(9) : 'Reducers may not dispatch actions.');\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach(listener => {\n listener();\n });\n return action;\n }\n\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param nextReducer The reducer for the store to use instead.\n */\n function replaceReducer(nextReducer: Reducer<S, A>): void {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage12(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = ((nextReducer as unknown) as Reducer<S, A, PreloadedState>);\n\n // This action has a similar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n dispatch(({\n type: ActionTypes.REPLACE\n } as A));\n }\n\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer: unknown) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage13(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = (observer as Observer<S>);\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [$$observable]() {\n return this;\n }\n };\n }\n\n // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n dispatch(({\n type: ActionTypes.INIT\n } as A));\n const store = (({\n dispatch: (dispatch as Dispatch<A>),\n subscribe,\n getState,\n replaceReducer,\n [$$observable]: observable\n } as unknown) as Store<S, A, StateExt> & Ext);\n return store;\n}\n\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A, PreloadedState>, preloadedState?: PreloadedState | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext;\nexport function legacy_createStore<S, A extends Action, Ext extends {} = {}, StateExt extends {} = {}, PreloadedState = S>(reducer: Reducer<S, A>, preloadedState?: PreloadedState | StoreEnhancer<Ext, StateExt> | undefined, enhancer?: StoreEnhancer<Ext, StateExt>): Store<S, A, UnknownIfNonSpecific<StateExt>> & Ext {\n return createStore(reducer, (preloadedState as any), enhancer);\n}","/**\n * 一个基于弱引用(WeakRef)的键值映射集合\n * \n * @template T - 值的类型,必须是对象类型(继承自 `object`)\n * \n * @example\n * const map = new WeakObjectMap<MyObject>();\n * map.set('key1', obj1);\n * const retrieved = map.get('key1'); // 返回 obj1 或 undefined(如果已被垃圾回收)\n */\nexport class WeakObjectMap<T extends object> {\n private map: Map<string, WeakRef<T>>;\n private finalizationRegistry: FinalizationRegistry<string>;\n \n /**\n * 构造一个新的 WeakObjectMap 实例\n */\n constructor() {\n this.map = new Map();\n this.finalizationRegistry = new FinalizationRegistry((key) => {\n this.map.delete(key);\n });\n }\n \n /**\n * 设置键值对\n * @param key - 字符串键名\n * @param value - 要存储的对象值(会被自动包装为弱引用)\n */\n set(key: string, value: T): void {\n const weakRef = new WeakRef(value);\n this.map.set(key, weakRef);\n this.finalizationRegistry.register(value, key);\n }\n \n /**\n * 获取指定键对应的值\n * @param key - 要查找的键名\n * @returns 如果值存在且未被垃圾回收则返回值,否则返回 undefined\n */\n get(key: string): T | undefined {\n const weakRef = this.map.get(key);\n return weakRef ? weakRef.deref() : undefined;\n }\n \n /**\n * 删除指定键的映射\n * @param key - 要删除的键名\n * @returns 如果键存在并已删除则返回 true,否则返回 false\n */\n delete(key: string): boolean {\n return this.map.delete(key);\n }\n \n /**\n * 检查是否存在指定键的映射(且值未被垃圾回收)\n * @param key - 要检查的键名\n * @returns 如果键存在且值未被回收则返回 true,否则返回 false\n */\n has(key: string): boolean {\n const weakRef = this.map.get(key);\n return weakRef ? weakRef.deref() !== undefined : false;\n }\n}\n","/**\n * \n * 基于开发工具\n * \n * Redux DevTools 是一个实用工具,用于开发和调试 Redux 应用程序。\n * FLEXEVENT是基于Redux DevTools 的简单包装,可以让开发者使用Redux DevTools\n * 来查看FLEXEVENT的状态变化 \n * \n * import { createStore } from \"@FLEXEVENTjs/react\"\n * import { install } from \"@FLEXEVENTjs/devtools\"\n * \n * \n * const store = createStore({})\n * \n * install()\n * \n */\n\n//@ts-ignore\nimport { legacy_createStore as createStore } from \"redux\"\nimport { WeakObjectMap } from \"./utils/WeakObjectMap\"\nimport { FastEvent } from \"./event\"\n\nconst initialState = {\n\n}\n\n\nfunction getDefaultFastEventState(instance: FastEvent) {\n return {\n messageCount: 0,\n listenerCount: instance.listenerCount,\n retainMessageCount: instance.retainedMessages.size,\n }\n}\n\nexport class FlexEventDevTools {\n private reduxStore: any\n private _installed: boolean = false\n fastEvents = new WeakObjectMap()\n constructor() {\n this.install()\n }\n add(instance: FastEvent) {\n this.fastEvents.set(instance.id, instance)\n\n instance.options.onAddListener = (type: string[], listener: any) => {\n this.reduxStore.dispatch({\n type: \"__ADD_LISTENER__\",\n event: type.join(\"/\"),\n listener,\n fastEventId: instance.id\n })\n }\n instance.options.onRemoveListener = (type: string[], listener: any) => {\n this.reduxStore.dispatch({\n type: \"__REMOVE_LISTENER__\",\n event: type.join(\"/\"),\n listener,\n fastEventId: instance.id\n })\n }\n instance.options.onClearListeners = () => {\n this.reduxStore.dispatch({\n type: \"__CLEAR_LISTENERS__\",\n fastEventId: instance.id\n })\n }\n instance.options.onExecuteListener = (message, returns, listeners) => {\n const results = returns.map(r => r instanceof Error ? `Error(${r.message})` : r)\n const sresults = listeners.map(listener => (listener as any).name || 'anonymous')\n .reduce((pre, cur, index) => {\n pre[cur] = results[index]\n return pre\n }, {})\n console.log(`FastEvent<\\x1B[31m${message.type}<\\x1B[30m> is emit, listeners:`, listeners)\n this.reduxStore.dispatch({\n type: message.type,\n payload: message.payload,\n meta: message.meta,\n returns: sresults,\n fastEventId: instance.id\n })\n }\n this.reduxStore.dispatch({\n type: \"__ADD_FASTEVENT__\",\n fastEventId: instance.id\n })\n }\n remove(instance: FastEvent) {\n if (this.fastEvents.has(instance.id)) {\n this.fastEvents.delete(instance.id)\n }\n }\n private reducer(state: any = initialState, action: any) {\n if (action.type.startsWith(\"@@\")) return state\n const instance = this.fastEvents.get(action.fastEventId) as FastEvent\n if (action.type === '__ADD_FASTEVENT__') {\n return {\n ...state,\n [action.fastEventId]: getDefaultFastEventState(instance)\n }\n } else if (action.type == '__ADD_LISTENER__') {\n const eventState = state[action.fastEventId] || getDefaultFastEventState(instance)\n eventState.listenerCount++\n return {\n ...state,\n [action.fastEventId]: {\n ...eventState\n }\n }\n } else if (action.type == '__REMOVE_LISTENER__') {\n const eventState = state[action.fastEventId]\n if (!eventState) return state\n eventState.listenerCount++\n return {\n ...state,\n [action.fastEventId]: {\n ...eventState\n }\n }\n } else if (action.type === '__CLEAR_LISTENERS__') {\n const eventState = state[action.fastEventId]\n if (!eventState) return state\n eventState.listenerCount++\n return {\n ...state,\n [action.fastEventId]: getDefaultFastEventState(instance)\n }\n } else {\n const eventState = state[action.fastEventId]\n if (!eventState) return state\n eventState.messageCount++\n eventState.listenerCount = instance.listenerCount\n eventState.retainMessageCount = instance.retainedMessages.size\n return {\n ...state,\n [action.fastEventId]: { ...eventState }\n }\n }\n }\n private install() {\n if (this._installed) return\n this.reduxStore = createStore(\n this.reducer.bind(this),\n // @ts-ignore\n window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()\n );\n this._installed = true\n console.info('%c FlexEventDevTools installed. Please open <Redux devtools> to view. %c', \"color:red;\", '')\n }\n}\n\nexport function install() {\n // @ts-ignore\n if (!globalThis.__FLEXEVENT_DEVTOOLS__) globalThis.__FLEXEVENT_DEVTOOLS__ = new FlexEventDevTools()\n}\n\ndeclare global {\n // @ts-ignore\n var __FLEXEVENT_DEVTOOLS__: FlexEventDevTools\n}\n\n\ninstall()\n\n"]}
|