Skip to content

Commit 3acb29c

Browse files
authored
Update README.md
use simplified idom.run in example + use new idom_jupyter.run func instead of display
1 parent 3a357b8 commit 3acb29c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ def Slideshow():
5656
url = f"https://picsum.photos/800/300?image={index}"
5757
return idom.html.img({"src": url, "onClick": lambda event: set_index(index + 1)})
5858

59-
server = idom.server.sanic.PerClientState(Slideshow)
60-
server.daemon("localhost", 8765).join()
59+
idom.run(Slideshow, port=8765)
6160
```
6261

6362
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
6766
You can even display the same thing in a Jupyter Notebook, just use [`idom_jupyter`](https://github.com/idom-team/idom-jupyter):
6867

6968
```python
70-
from idom_jupyter import display
71-
display(Slideshow)
69+
import idom_jupyter
70+
idom_jupyter.run(Slideshow)
7271
```
7372

7473
Every click will then cause the image to change (it won't here of course).

0 commit comments

Comments
 (0)