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())
```
Comments URL: https://news.ycombinator.com/item?id=42880873
Points: 6
# Comments: 1
Войдите, чтобы добавить комментарий
Другие сообщения в этой группе

Hello HN!
I've built a web app that helps you discover new shows and movies you'll actually enjoy by:
- Connecting to your Sonarr/Radarr/Plex instances to understand your media library
- Lev

Article URL: https://news.nus.edu.sg/nus-researchers-develop-new-battery-free-technology/
Comments

Article URL: https://letmegptthatforyou.com
Comments URL: https://news.ycombinator.com/i

Article URL: https://olduse.net/
Comments URL: https://news.ycombinator.com/item?id=43233305