@flexsurfer/reflex 0.1.17 → 0.1.18

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/dist/index.cjs CHANGED
@@ -50,6 +50,7 @@ __export(src_exports, {
50
50
  getAppDb: () => getAppDb,
51
51
  getGlobalInterceptors: () => getGlobalInterceptors,
52
52
  getHandler: () => getHandler,
53
+ getHandlers: () => getHandlers,
53
54
  getReactions: () => getReactions,
54
55
  getSubscriptionValue: () => getSubscriptionValue,
55
56
  initAppDb: () => initAppDb,
@@ -62,6 +63,7 @@ __export(src_exports, {
62
63
  regSub: () => regSub,
63
64
  registerHotReloadCallback: () => registerHotReloadCallback,
64
65
  registerTraceCb: () => registerTraceCb,
66
+ removeTraceCb: () => removeTraceCb,
65
67
  setupSubsHotReload: () => setupSubsHotReload,
66
68
  throttleAndDispatch: () => throttleAndDispatch,
67
69
  triggerHotReload: () => triggerHotReload,
@@ -107,6 +109,9 @@ function getHandler(kind, id) {
107
109
  }
108
110
  return handler;
109
111
  }
112
+ function getHandlers() {
113
+ return kindToIdToHandler;
114
+ }
110
115
  function registerHandler(kind, id, handlerFn) {
111
116
  if (kindToIdToHandler[kind][id]) {
112
117
  consoleLog("warn", `[reflex] overwriting ${kind} handler for:`, id);
@@ -642,6 +647,9 @@ function registerTraceCb(key, cb) {
642
647
  }
643
648
  traceCbs.set(key, cb);
644
649
  }
650
+ function removeTraceCb(key) {
651
+ traceCbs.delete(key);
652
+ }
645
653
  function scheduleFlush() {
646
654
  if (debounceTimer)
647
655
  return;
@@ -1239,6 +1247,7 @@ function HotReloadWrapper({ children }) {
1239
1247
  getAppDb,
1240
1248
  getGlobalInterceptors,
1241
1249
  getHandler,
1250
+ getHandlers,
1242
1251
  getReactions,
1243
1252
  getSubscriptionValue,
1244
1253
  initAppDb,
@@ -1251,6 +1260,7 @@ function HotReloadWrapper({ children }) {
1251
1260
  regSub,
1252
1261
  registerHotReloadCallback,
1253
1262
  registerTraceCb,
1263
+ removeTraceCb,
1254
1264
  setupSubsHotReload,
1255
1265
  throttleAndDispatch,
1256
1266
  triggerHotReload,
package/dist/index.d.cts CHANGED
@@ -163,6 +163,7 @@ declare function clearGlobalInterceptors(id: string): void;
163
163
  type Kind = 'event' | 'fx' | 'cofx' | 'sub' | 'subDeps' | 'error';
164
164
  type RegistryHandler = EventHandler | EffectHandler | CoEffectHandler | ErrorHandler | SubHandler | SubDepsHandler;
165
165
  declare function getHandler<T extends RegistryHandler = RegistryHandler>(kind: Kind, id: Id): T | undefined;
166
+ declare function getHandlers(): Record<Kind, Record<string, RegistryHandler>>;
166
167
  declare function clearHandlers(): void;
167
168
  declare function clearHandlers(kind: Kind): void;
168
169
  declare function clearHandlers(kind: Kind, id: string): void;
@@ -251,6 +252,7 @@ type TraceCallback = (traces: Trace[]) => void;
251
252
  declare function enableTracing(): void;
252
253
  declare function disableTracing(): void;
253
254
  declare function registerTraceCb(key: string, cb: TraceCallback): void;
255
+ declare function removeTraceCb(key: string): void;
254
256
  declare function enableTracePrint(): void;
255
257
 
256
- export { CoEffectHandler, CoEffects, Context, DISPATCH, DISPATCH_LATER, Db, DispatchLaterEffect, EffectHandler, Effects, ErrorHandler, EventHandler, EventVector, HotReloadWrapper, Id, Interceptor, NOW, RANDOM, SubVector, clearGlobalInterceptors, clearHandlers, clearHotReloadCallbacks, clearReactions, clearSubs, current, debounceAndDispatch, defaultErrorHandler, disableTracing, dispatch, enableTracePrint, enableTracing, getAppDb, getGlobalInterceptors, getHandler, getReactions, getSubscriptionValue, initAppDb, original, regCoeffect, regEffect, regEvent, regEventErrorHandler, regGlobalInterceptor, regSub, registerHotReloadCallback, registerTraceCb, setupSubsHotReload, throttleAndDispatch, triggerHotReload, useHotReload, useHotReloadKey, useSubscription };
258
+ export { CoEffectHandler, CoEffects, Context, DISPATCH, DISPATCH_LATER, Db, DispatchLaterEffect, EffectHandler, Effects, ErrorHandler, EventHandler, EventVector, HotReloadWrapper, Id, Interceptor, NOW, RANDOM, SubVector, clearGlobalInterceptors, clearHandlers, clearHotReloadCallbacks, clearReactions, clearSubs, current, debounceAndDispatch, defaultErrorHandler, disableTracing, dispatch, enableTracePrint, enableTracing, getAppDb, getGlobalInterceptors, getHandler, getHandlers, getReactions, getSubscriptionValue, initAppDb, original, regCoeffect, regEffect, regEvent, regEventErrorHandler, regGlobalInterceptor, regSub, registerHotReloadCallback, registerTraceCb, removeTraceCb, setupSubsHotReload, throttleAndDispatch, triggerHotReload, useHotReload, useHotReloadKey, useSubscription };
package/dist/index.d.ts CHANGED
@@ -163,6 +163,7 @@ declare function clearGlobalInterceptors(id: string): void;
163
163
  type Kind = 'event' | 'fx' | 'cofx' | 'sub' | 'subDeps' | 'error';
164
164
  type RegistryHandler = EventHandler | EffectHandler | CoEffectHandler | ErrorHandler | SubHandler | SubDepsHandler;
165
165
  declare function getHandler<T extends RegistryHandler = RegistryHandler>(kind: Kind, id: Id): T | undefined;
166
+ declare function getHandlers(): Record<Kind, Record<string, RegistryHandler>>;
166
167
  declare function clearHandlers(): void;
167
168
  declare function clearHandlers(kind: Kind): void;
168
169
  declare function clearHandlers(kind: Kind, id: string): void;
@@ -251,6 +252,7 @@ type TraceCallback = (traces: Trace[]) => void;
251
252
  declare function enableTracing(): void;
252
253
  declare function disableTracing(): void;
253
254
  declare function registerTraceCb(key: string, cb: TraceCallback): void;
255
+ declare function removeTraceCb(key: string): void;
254
256
  declare function enableTracePrint(): void;
255
257
 
256
- export { CoEffectHandler, CoEffects, Context, DISPATCH, DISPATCH_LATER, Db, DispatchLaterEffect, EffectHandler, Effects, ErrorHandler, EventHandler, EventVector, HotReloadWrapper, Id, Interceptor, NOW, RANDOM, SubVector, clearGlobalInterceptors, clearHandlers, clearHotReloadCallbacks, clearReactions, clearSubs, current, debounceAndDispatch, defaultErrorHandler, disableTracing, dispatch, enableTracePrint, enableTracing, getAppDb, getGlobalInterceptors, getHandler, getReactions, getSubscriptionValue, initAppDb, original, regCoeffect, regEffect, regEvent, regEventErrorHandler, regGlobalInterceptor, regSub, registerHotReloadCallback, registerTraceCb, setupSubsHotReload, throttleAndDispatch, triggerHotReload, useHotReload, useHotReloadKey, useSubscription };
258
+ export { CoEffectHandler, CoEffects, Context, DISPATCH, DISPATCH_LATER, Db, DispatchLaterEffect, EffectHandler, Effects, ErrorHandler, EventHandler, EventVector, HotReloadWrapper, Id, Interceptor, NOW, RANDOM, SubVector, clearGlobalInterceptors, clearHandlers, clearHotReloadCallbacks, clearReactions, clearSubs, current, debounceAndDispatch, defaultErrorHandler, disableTracing, dispatch, enableTracePrint, enableTracing, getAppDb, getGlobalInterceptors, getHandler, getHandlers, getReactions, getSubscriptionValue, initAppDb, original, regCoeffect, regEffect, regEvent, regEventErrorHandler, regGlobalInterceptor, regSub, registerHotReloadCallback, registerTraceCb, removeTraceCb, setupSubsHotReload, throttleAndDispatch, triggerHotReload, useHotReload, useHotReloadKey, useSubscription };
package/dist/index.mjs CHANGED
@@ -34,6 +34,9 @@ function getHandler(kind, id) {
34
34
  }
35
35
  return handler;
36
36
  }
37
+ function getHandlers() {
38
+ return kindToIdToHandler;
39
+ }
37
40
  function registerHandler(kind, id, handlerFn) {
38
41
  if (kindToIdToHandler[kind][id]) {
39
42
  consoleLog("warn", `[reflex] overwriting ${kind} handler for:`, id);
@@ -569,6 +572,9 @@ function registerTraceCb(key, cb) {
569
572
  }
570
573
  traceCbs.set(key, cb);
571
574
  }
575
+ function removeTraceCb(key) {
576
+ traceCbs.delete(key);
577
+ }
572
578
  function scheduleFlush() {
573
579
  if (debounceTimer)
574
580
  return;
@@ -1165,6 +1171,7 @@ export {
1165
1171
  getAppDb,
1166
1172
  getGlobalInterceptors,
1167
1173
  getHandler,
1174
+ getHandlers,
1168
1175
  getReactions,
1169
1176
  getSubscriptionValue,
1170
1177
  initAppDb,
@@ -1177,6 +1184,7 @@ export {
1177
1184
  regSub,
1178
1185
  registerHotReloadCallback,
1179
1186
  registerTraceCb,
1187
+ removeTraceCb,
1180
1188
  setupSubsHotReload,
1181
1189
  throttleAndDispatch,
1182
1190
  triggerHotReload,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexsurfer/reflex",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",