Skip to content

Commit b01b1fe

Browse files
committed
rename refresh method
Signed-off-by: Valerie Gleason πŸ‘Œ <[email protected]>
1 parent 92b5007 commit b01b1fe

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

β€Žsrc/nipanel/_streamlit_panel_initializer.pyβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from typing import cast
22

33
import streamlit as st
4+
from streamlit_components.refresh import initialize_refresh_component
45

56
from nipanel._streamlit_panel_value_accessor import StreamlitPanelValueAccessor
6-
from nipanel.panel_refresh import add_refresh_component
77

88
PANEL_ACCESSOR_KEY = "StreamlitPanelValueAccessor"
99

@@ -23,7 +23,7 @@ def initialize_panel() -> StreamlitPanelValueAccessor:
2323
st.session_state[PANEL_ACCESSOR_KEY] = _initialize_panel_from_base_path()
2424

2525
panel = cast(StreamlitPanelValueAccessor, st.session_state[PANEL_ACCESSOR_KEY])
26-
refresh_component = add_refresh_component(panel.panel_id)
26+
refresh_component = initialize_refresh_component(panel.panel_id)
2727
refresh_component()
2828
return panel
2929

β€Žsrc/nipanel/panel_refresh/__init__.pyβ€Ž renamed to β€Žsrc/nipanel/streamlit_components/refresh/__init__.pyβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
from nipanel._streamlit_constants import STREAMLIT_REFRESH_COMPONENT_URL
88

99

10-
def add_refresh_component(panel_id: str) -> Any:
10+
def initialize_refresh_component(panel_id: str) -> Any:
1111
"""Add a refresh component to the Streamlit app."""
12-
refresh_component = components.declare_component(
12+
_refresh_component_func = components.declare_component(
1313
"panelRefreshComponent",
1414
url=f"{STREAMLIT_REFRESH_COMPONENT_URL}/{panel_id}",
1515
)
1616

17-
return refresh_component
17+
return _refresh_component_func

0 commit comments

Comments
Β (0)