You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define the interactivity. We use `@app.startup` to restore state when the page loads, and `@app.client` to handle user interactions.
97
+
Define the interactivity. We use `@app.startup` to restore state when the page loads.
98
98
99
99
```python
100
100
@app.startup
@@ -111,7 +111,11 @@ async def init_counter():
111
111
if saved_count is not None:
112
112
Document.find("display").text = str(saved_count)
113
113
print(f"Restored count: {saved_count}")
114
+
```
115
+
116
+
And we use `@app.client` to handle user interactions and run Python code in the browser. Check out the Pythonic API for interacting with the DOM and the LocalStorage. We can also call server-side functions seamlessly, via automagic RPC (Remote Procedure Call).
114
117
118
+
```python
115
119
@app.client
116
120
async def handle_change(event: Event):
117
121
"""
@@ -225,8 +229,7 @@ We are currently in v1.0 (Core). Here is the vision for the immediate future of
225
229
226
230
## 🤝 Contribution
227
231
228
-
`violetear` is open-source and we love contributions\!
229
-
Check out the [Design Philosophy](https://www.google.com/search?q=docs/design.md) to understand our "Unopinionated" and "Zero-Dependency Core" approach.
232
+
`violetear` is open-source and we love contributions!
0 commit comments