Thursday, January 30, 2025
Show HN: Reactive Signals for Python – inspired by Angular's reactivity model https://ift.tt/KnhJZLx
Show HN: Reactive Signals for Python – inspired by Angular's reactivity model Hey everyone, I built reaktiv, a small reactive signals library for Python, inspired by Angular’s reactivity model. It lets you define Signals, Computed Values, and Effects that automatically track dependencies and update efficiently. The main focus is async-first reactivity without external dependencies. Here is an example code: ``` import asyncio from reaktiv import Signal, ComputeSignal, Effect async def main(): count = Signal(0) doubled = ComputeSignal(lambda: count.get() * 2) async def log_count(): print(f"Count: {count.get()}, Doubled: {doubled.get()}") Effect(log_count).schedule() count.set(5) # Triggers: "Count: 5, Doubled: 10" await asyncio.sleep(0) # Allow effects to process asyncio.run(main()) ``` https://ift.tt/ZJgX0Dz January 31, 2025 at 12:26AM
Subscribe to:
Post Comments (Atom)
Show HN: AI quiz generator from any topic or book in seconds https://ift.tt/8f7I9vU
Show HN: AI quiz generator from any topic or book in seconds https://www.wiyomi.com April 10, 2025 at 10:57AM
-
Show HN: High school robotics code/CAD/design binder release Hello HN! My name is Patrick, and I am a junior at my High School’s FRC robotic...
-
Show HN: D&D meets Siri – Interactive voice adventure Hey HN! I've been building tooling for voice-driven apps over the past few mon...
-
Show HN: I Made an AI Social Media Manager to Automate Content Creation Hey HN, I am a Solopreneur, and I love building apps to automate bor...
No comments:
Post a Comment