@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 +4 -2
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +1 -0
- package/package.json +1 -1
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
|
|
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
|
|
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