Repository navigation
Dars Framework v1.4.9
Release Notes v1.4.9
Event Handler Support & Dual State System Documentation
Installation
pip install --upgrade dars-frameworkWhat's New
State V2: Event Handler Support
State V2 now supports updating event handlers:
from dars.all import *
# Update events in State V2
state.update(
text="Click me",
on_click=alert("Success!"),
on_mouseover=log("mouseOver click me"))
)
# Works with dScript objects
button_state.update(on_click=log("Clicked!"))Implementation:
- Automatic detection of
on_*properties - Extracts
.codefrom dScript objects - Handles arrays of event handlers
- Gracefully skips non-serializable values
Dual State System Documentation
Documentation now presents two coexisting state management systems:
State V2 (Dynamic)
- Auto-increment/decrement built-in
- Best for: counters, timers, simple updates
dState/cState (Indexed)
- Full state machine support
- Immutable state 0
- Cross-state calls with
Mod.call() - Best for: workflows, complex UI transitions
Comprehensive comparison table and use case guidance added to state management documentation.
Bug Fixes
- Fixed: State V2 can now handle dScript event handlers without errors
- Fixed:
_generate_change_call()properly handles non-JSON-serializable values
Documentation
- Complete restructure of State Management docs to include both systems
- Restored all original dState/cState documentation