@@ -71,8 +71,8 @@ def display(
7171 mount : Callable [..., None ],
7272 host : str ,
7373 port : int ,
74- display_id : idom .Var [int ],
75- last_server_error : idom .Var [Exception ],
74+ display_id : idom .Ref [int ],
75+ last_server_error : idom .Ref [Exception ],
7676) -> Iterator [Callable [[Union [ElementConstructor , AbstractElement ], str ], None ]]:
7777 """A function for displaying an element using the current web driver."""
7878
@@ -81,7 +81,8 @@ def display(
8181 query : str = "" ,
8282 check_mount : bool = True ,
8383 ):
84- d_id = display_id .set (display_id .value + 1 )
84+ d_id = display_id .current
85+ display_id .current += 1
8586 display_attrs = {"id" : f"display-{ d_id } " }
8687 element_constructor = element if callable (element ) else lambda : element
8788 mount (lambda : idom .html .div (display_attrs , element_constructor ()))
@@ -93,7 +94,7 @@ def display(
9394 try :
9495 yield display
9596 finally :
96- last_error = last_server_error .get ()
97+ last_error = last_server_error .current
9798 if last_error is default_error :
9899 msg = f"The server { server } never ran or did not set the 'last_server_error' fixture."
99100 raise NotImplementedError (msg )
@@ -122,8 +123,8 @@ def driver_wait(driver: Chrome, driver_timeout: float) -> WebDriverWait:
122123
123124
124125@pytest .fixture (scope = "session" )
125- def display_id () -> idom .Var [int ]:
126- return idom .Var (0 )
126+ def display_id () -> idom .Ref [int ]:
127+ return idom .Ref (0 )
127128
128129
129130@pytest .fixture (scope = "module" )
@@ -190,7 +191,7 @@ def mount_and_server(
190191 fixturized_server_type : Type [AbstractRenderServer ],
191192 host : str ,
192193 port : int ,
193- last_server_error : idom .Var [Exception ],
194+ last_server_error : idom .Ref [Exception ],
194195) -> Tuple [Callable [..., None ], AbstractRenderServer ]:
195196 """An IDOM layout mount function and server as a tuple
196197
@@ -254,8 +255,8 @@ def port(host: str) -> int:
254255
255256@pytest .fixture (scope = "session" )
256257def last_server_error ():
257- """A ``Var `` containing the last server error. This must be populated by ``server_type``"""
258- return idom .Var (default_error )
258+ """A ``Ref `` containing the last server error. This must be populated by ``server_type``"""
259+ return idom .Ref (default_error )
259260
260261
261262@pytest .fixture (autouse = True )
0 commit comments