-
-
Save rmorshea/35d7d76442da68503b88fb9b37cc099d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from the_library import mount, element | |
from vdom.helpers import p, div | |
@element | |
# it'd be possible to leverage asyncio | |
async def hello(who): | |
return p(f"hello {who}") | |
@hello.updated | |
def hello(old, new): | |
print(f"it updated from {old} to {new}") | |
@element | |
def greeting(): | |
h = hello("world") | |
biggerGreeting = lambda event : h.who("universe") | |
return div(h, onClick=biggerGreeting) | |
mount("ws://websocket-stuff", greeting()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment