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
Connectez-vous pour ajouter un commentaire
Autres messages de ce groupe
![Transformer Implemented Using Excel](https://www.cdn5.niftycent.com/a/D/P/d/9/2/J/transformer-implemented-using-excel.webp)
Article URL: https://www.byhand.ai/p/transformer-spreadsheet
![Robust Autonomy Emerges from Self-Play](https://www.cdn5.niftycent.com/a/k/l/6/3/d/P/robust-autonomy-emerges-from-self-play.webp)
Article URL: https://arxiv.org/abs/2502.03349
Comments URL: https://news.ycombinator.c
Article URL: https://skilldrick.github.io/easy6502/
Comments URL: https://news.y
I made this, and it's fully open source so if someone wants to contribute here you have the url: https://github.com/Miguel07Alm/arxivtok.
Fo
Article URL: https://tillitis.se/products/tkey/
Comments URL: https://news.ycombinat