Skip to content

Commit cbc303c

Browse files
committed
Add notes on local storage; lints
1 parent a40f268 commit cbc303c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

shiny/session/_session.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ def on_bookmark(
230230

231231
@abstractmethod
232232
def on_bookmarked(
233-
self, callback: Callable[[str], None] | Callable[[str], Awaitable[None]], /
233+
self,
234+
callback: Callable[[str], None] | Callable[[str], Awaitable[None]],
235+
/,
234236
) -> None:
235237
"""
236238
Registers a function that will be called just after bookmarking state.
@@ -353,6 +355,12 @@ async def root_state_on_save(state: ShinySaveState) -> None:
353355
query_string = await root_state._save_state()
354356
elif self.store == "url":
355357
query_string = await root_state._encode_state()
358+
# # Can we have browser storage?
359+
# elif self.store == "browser":
360+
# get_json object
361+
# get consistent storage value (not session id)
362+
# send object to browser storage
363+
# return server-like-id url value
356364
else:
357365
raise ValueError("Unknown bookmark store: " + self.store)
358366

@@ -467,7 +475,9 @@ def on_bookmark(
467475
self._root_bookmark.on_bookmark(callback)
468476

469477
def on_bookmarked(
470-
self, callback: Callable[[str], None] | Callable[[str], Awaitable[None]], /
478+
self,
479+
callback: Callable[[str], None] | Callable[[str], Awaitable[None]],
480+
/,
471481
) -> None:
472482
# TODO: Barret - Q: Shouldn't we implement this? `self._root_bookmark.on_bookmark()`
473483
raise NotImplementedError(

0 commit comments

Comments
 (0)