88from reflex .components .sonner .toast import toast as toast
99
1010from ..utils .console import warn
11+ from ..utils .misc import run_in_thread
1112from . import hooks as hooks
1213from .client_state import ClientStateVar as ClientStateVar
1314from .layout import layout as layout
14- from .misc import run_in_thread as run_in_thread
1515
1616
1717class ExperimentalNamespace (SimpleNamespace ):
@@ -46,23 +46,35 @@ def toast(self):
4646
4747 @property
4848 def progress (self ):
49- """Temporary property returning the toast namespace .
49+ """Temporary property returning the progress component .
5050
51- Remove this property when toast is fully promoted.
51+ Remove this property when progress is fully promoted.
5252
5353 Returns:
54- The toast namespace .
54+ The progress component .
5555 """
5656 self .register_component_warning ("progress" )
5757 return progress
5858
59+ @property
60+ def run_in_thread (self ):
61+ """Temporary property returning the run_in_thread helper function.
62+
63+ Remove this property when run_in_thread is fully promoted.
64+
65+ Returns:
66+ The run_in_thread helper function.
67+ """
68+ self .register_component_warning ("run_in_thread" )
69+ return run_in_thread
70+
5971 @staticmethod
6072 def register_component_warning (component_name : str ):
6173 """Add component to emitted warnings and throw a warning if it
6274 doesn't exist.
6375
6476 Args:
65- component_name: name of the component.
77+ component_name: name of the component.
6678 """
6779 warn (
6880 f"`rx._x.{ component_name } ` was promoted to `rx.{ component_name } `." ,
@@ -75,6 +87,5 @@ def register_component_warning(component_name: str):
7587 hooks = hooks ,
7688 layout = layout ,
7789 PropsBase = PropsBase ,
78- run_in_thread = run_in_thread ,
7990 code_block = code_block ,
8091)
0 commit comments