Skip to content

Commit

Permalink
set pull-based reactivity as default for jupyterlab
Browse files Browse the repository at this point in the history
  • Loading branch information
smacke committed Jan 21, 2024
1 parent 7b065ab commit 51b5e91
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/ipyflow/flow.py
Expand Up @@ -84,6 +84,7 @@ def __init__(self, **kwargs) -> None:
getattr(config, "mark_phantom_cell_usages_unsafe", False),
),
)
interface = kwargs.pop("interface", Interface.UNKNOWN)
self.mut_settings: MutableDataflowSettings = MutableDataflowSettings(
dataflow_enabled=kwargs.pop("dataflow_enabled", True),
trace_messages_enabled=kwargs.pop("trace_messages_enabled", False),
Expand Down Expand Up @@ -131,7 +132,9 @@ def __init__(self, **kwargs) -> None:
),
pull_reactive_updates=kwargs.pop(
"pull_reactive_updates",
getattr(config, "pull_reactive_updates", False),
getattr(
config, "pull_reactive_updates", interface == Interface.JUPYTERLAB
),
),
color_scheme=ColorScheme(
kwargs.pop(
Expand Down Expand Up @@ -341,14 +344,14 @@ def initialize(
pull_reactive_updates = getattr(
config,
"pull_reactive_updates",
kwargs.get("pull_reactive_updates"),
kwargs.get("pull_reactive_updates", iface == Interface.JUPYTERLAB),
)
if push_reactive_updates is not None:
self.mut_settings.push_reactive_updates = push_reactive_updates
if push_reactive_updates_to_cousins is not None:
self.mut_settings.push_reactive_updates = push_reactive_updates_to_cousins
if pull_reactive_updates is not None:
self.mut_settings.pull_reactive_updates = iface == Interface.JUPYTERLAB
self.mut_settings.pull_reactive_updates = pull_reactive_updates
self.mut_settings.color_scheme = ColorScheme(
getattr(
config,
Expand Down

0 comments on commit 51b5e91

Please sign in to comment.