File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,7 @@ def Slideshow():
56
56
url = f " https://picsum.photos/800/300?image= { index} "
57
57
return idom.html.img({" src" : url, " onClick" : lambda event : set_index(index + 1 )})
58
58
59
- server = idom.server.sanic.PerClientState(Slideshow)
60
- server.daemon(" localhost" , 8765 ).join()
59
+ idom.run(Slideshow, port = 8765 )
61
60
```
62
61
63
62
Running this will serve our slideshow to ` "https://localhost:8765/client/index.html" `
@@ -67,8 +66,8 @@ Running this will serve our slideshow to `"https://localhost:8765/client/index.h
67
66
You can even display the same thing in a Jupyter Notebook, just use [ ` idom_jupyter ` ] ( https://github.com/idom-team/idom-jupyter ) :
68
67
69
68
``` python
70
- from idom_jupyter import display
71
- display (Slideshow)
69
+ import idom_jupyter
70
+ idom_jupyter.run (Slideshow)
72
71
```
73
72
74
73
Every click will then cause the image to change (it won't here of course).
You can’t perform that action at this time.
0 commit comments