@flexsurfer/reflex 0.1.4 → 0.1.6

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/README.md CHANGED
@@ -16,7 +16,7 @@ A reactive, functional state management library that brings the elegance and pow
16
16
 
17
17
  ## ✨ Why Reflex?
18
18
 
19
- After 10+ years of building applications with re-frame in the ClojureScript world, I wanted to bring the same architectural elegance to the JavaScript/TypeScript ecosystem. Reflex is not just another state management library—it's a battle-tested pattern that promotes:
19
+ After many years of building applications with re-frame in the ClojureScript world, I wanted to bring the same architectural elegance to the JavaScript/TypeScript ecosystem. Reflex is not just another state management library—it's a battle-tested pattern that promotes:
20
20
 
21
21
  🎯 **Predictable State Management** - Unidirectional data flow with pure functions
22
22
  🧩 **Composable Architecture** - Build complex apps from simple, reusable pieces
@@ -266,7 +266,9 @@ regSub('count');
266
266
  - [re-frame Documentation](https://day8.github.io/re-frame/re-frame/) - The original and comprehensive guide to understanding the philosophy and patterns
267
267
  - Step-by-Step Tutorial - TBD
268
268
  - API Reference - TBD
269
- - Examples - TBD
269
+ - Examples
270
+ - [TodoMVC](https://github.com/flexsurfer/reflex/tree/main/examples/todomvc) - Classic todo app implementation showcasing core reflex patterns
271
+ - [Einbürgerungstest](https://github.com/flexsurfer/einburgerungstest/) - German citizenship test app built with reflex ([Live Demo](https://www.ebtest.org/))
270
272
  - Best Practices - TBD
271
273
 
272
274
  ## 🤝 Contributing
package/dist/index.cjs CHANGED
@@ -43,6 +43,7 @@ __export(src_exports, {
43
43
  enableTracePrint: () => enableTracePrint,
44
44
  enableTracing: () => enableTracing,
45
45
  getGlobalInterceptors: () => getGlobalInterceptors,
46
+ getHandler: () => getHandler,
46
47
  getSubscriptionValue: () => getSubscriptionValue,
47
48
  initAppDb: () => initAppDb,
48
49
  isDebugEnabled: () => isDebugEnabled,
@@ -1206,6 +1207,7 @@ function HotReloadWrapper({ children }) {
1206
1207
  enableTracePrint,
1207
1208
  enableTracing,
1208
1209
  getGlobalInterceptors,
1210
+ getHandler,
1209
1211
  getSubscriptionValue,
1210
1212
  initAppDb,
1211
1213
  isDebugEnabled,
package/dist/index.d.cts CHANGED
@@ -11,6 +11,8 @@ type ErrorHandler = (originalError: Error, reFrameError: Error & {
11
11
  data: any;
12
12
  }) => void;
13
13
  type SubVector = [Id, ...any[]];
14
+ type SubHandler = (...values: any[]) => any;
15
+ type SubDepsHandler = (...params: any[]) => SubVector[];
14
16
  type Effects = [string, any][];
15
17
  interface DispatchLaterEffect {
16
18
  ms: number;
@@ -108,6 +110,8 @@ declare function setDebugEnabled(enabled: boolean): void;
108
110
  declare function isDebugEnabled(): boolean;
109
111
 
110
112
  type Kind = 'event' | 'fx' | 'cofx' | 'sub' | 'subDeps' | 'error';
113
+ type RegistryHandler = EventHandler | EffectHandler | CoEffectHandler | ErrorHandler | SubHandler | SubDepsHandler;
114
+ declare function getHandler<T extends RegistryHandler = RegistryHandler>(kind: Kind, id: Id): T | undefined;
111
115
  declare function clearHandlers(): void;
112
116
  declare function clearHandlers(kind: Kind): void;
113
117
  declare function clearHandlers(kind: Kind, id: string): void;
@@ -200,4 +204,4 @@ declare function disableTracing(): void;
200
204
  declare function registerTraceCb(key: string, cb: TraceCallback): void;
201
205
  declare function enableTracePrint(): void;
202
206
 
203
- export { CoEffectHandler, CoEffects, Context, Db, DispatchLaterEffect, EffectHandler, Effects, ErrorHandler, EventHandler, EventVector, HotReloadWrapper, Id, Interceptor, SubVector, clearGlobalInterceptors, clearHandlers, clearHotReloadCallbacks, clearReactions, clearSubs, debounceAndDispatch, defaultErrorHandler, disableTracing, dispatch, enableTracePrint, enableTracing, getGlobalInterceptors, getSubscriptionValue, initAppDb, isDebugEnabled, regCoeffect, regEffect, regEvent, regEventErrorHandler, regGlobalInterceptor, regSub, registerHotReloadCallback, registerTraceCb, setDebugEnabled, setupSubsHotReload, throttleAndDispatch, triggerHotReload, useHotReload, useHotReloadKey, useSubscription };
207
+ export { CoEffectHandler, CoEffects, Context, Db, DispatchLaterEffect, EffectHandler, Effects, ErrorHandler, EventHandler, EventVector, HotReloadWrapper, Id, Interceptor, SubVector, clearGlobalInterceptors, clearHandlers, clearHotReloadCallbacks, clearReactions, clearSubs, debounceAndDispatch, defaultErrorHandler, disableTracing, dispatch, enableTracePrint, enableTracing, getGlobalInterceptors, getHandler, getSubscriptionValue, initAppDb, isDebugEnabled, regCoeffect, regEffect, regEvent, regEventErrorHandler, regGlobalInterceptor, regSub, registerHotReloadCallback, registerTraceCb, setDebugEnabled, setupSubsHotReload, throttleAndDispatch, triggerHotReload, useHotReload, useHotReloadKey, useSubscription };
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ type ErrorHandler = (originalError: Error, reFrameError: Error & {
11
11
  data: any;
12
12
  }) => void;
13
13
  type SubVector = [Id, ...any[]];
14
+ type SubHandler = (...values: any[]) => any;
15
+ type SubDepsHandler = (...params: any[]) => SubVector[];
14
16
  type Effects = [string, any][];
15
17
  interface DispatchLaterEffect {
16
18
  ms: number;
@@ -108,6 +110,8 @@ declare function setDebugEnabled(enabled: boolean): void;
108
110
  declare function isDebugEnabled(): boolean;
109
111
 
110
112
  type Kind = 'event' | 'fx' | 'cofx' | 'sub' | 'subDeps' | 'error';
113
+ type RegistryHandler = EventHandler | EffectHandler | CoEffectHandler | ErrorHandler | SubHandler | SubDepsHandler;
114
+ declare function getHandler<T extends RegistryHandler = RegistryHandler>(kind: Kind, id: Id): T | undefined;
111
115
  declare function clearHandlers(): void;
112
116
  declare function clearHandlers(kind: Kind): void;
113
117
  declare function clearHandlers(kind: Kind, id: string): void;
@@ -200,4 +204,4 @@ declare function disableTracing(): void;
200
204
  declare function registerTraceCb(key: string, cb: TraceCallback): void;
201
205
  declare function enableTracePrint(): void;
202
206
 
203
- export { CoEffectHandler, CoEffects, Context, Db, DispatchLaterEffect, EffectHandler, Effects, ErrorHandler, EventHandler, EventVector, HotReloadWrapper, Id, Interceptor, SubVector, clearGlobalInterceptors, clearHandlers, clearHotReloadCallbacks, clearReactions, clearSubs, debounceAndDispatch, defaultErrorHandler, disableTracing, dispatch, enableTracePrint, enableTracing, getGlobalInterceptors, getSubscriptionValue, initAppDb, isDebugEnabled, regCoeffect, regEffect, regEvent, regEventErrorHandler, regGlobalInterceptor, regSub, registerHotReloadCallback, registerTraceCb, setDebugEnabled, setupSubsHotReload, throttleAndDispatch, triggerHotReload, useHotReload, useHotReloadKey, useSubscription };
207
+ export { CoEffectHandler, CoEffects, Context, Db, DispatchLaterEffect, EffectHandler, Effects, ErrorHandler, EventHandler, EventVector, HotReloadWrapper, Id, Interceptor, SubVector, clearGlobalInterceptors, clearHandlers, clearHotReloadCallbacks, clearReactions, clearSubs, debounceAndDispatch, defaultErrorHandler, disableTracing, dispatch, enableTracePrint, enableTracing, getGlobalInterceptors, getHandler, getSubscriptionValue, initAppDb, isDebugEnabled, regCoeffect, regEffect, regEvent, regEventErrorHandler, regGlobalInterceptor, regSub, registerHotReloadCallback, registerTraceCb, setDebugEnabled, setupSubsHotReload, throttleAndDispatch, triggerHotReload, useHotReload, useHotReloadKey, useSubscription };
package/dist/index.mjs CHANGED
@@ -1139,6 +1139,7 @@ export {
1139
1139
  enableTracePrint,
1140
1140
  enableTracing,
1141
1141
  getGlobalInterceptors,
1142
+ getHandler,
1142
1143
  getSubscriptionValue,
1143
1144
  initAppDb,
1144
1145
  isDebugEnabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexsurfer/reflex",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",