From 83a09a454d2b39b265aecfd608bc0abef80433ca Mon Sep 17 00:00:00 2001 From: Sourcegraph Date: Thu, 18 Jan 2024 20:44:41 +0000 Subject: [PATCH] Convert w_flux Action to ActionV2 --- example/web/panel/modules/data_load_async_module.dart | 4 ++-- example/web/panel/modules/flux_module.dart | 4 ++-- example/web/panel/modules/hierarchy_module.dart | 4 ++-- example/web/panel/modules/panel_module.dart | 2 +- example/web/panel/modules/reject_module.dart | 4 ++-- example/web/random_color/random_color.dart | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/example/web/panel/modules/data_load_async_module.dart b/example/web/panel/modules/data_load_async_module.dart index 20bad417..01571abe 100644 --- a/example/web/panel/modules/data_load_async_module.dart +++ b/example/web/panel/modules/data_load_async_module.dart @@ -49,7 +49,7 @@ class DataLoadAsyncModule extends Module { // trigger non-blocking async load of data listenToStream(_events.didLoadData.take(1), (_) => specifyStartupTiming(StartupTimingType.firstUseful)); - _actions.loadData(); + _actions.loadData(null); return Future.value(); } } @@ -66,7 +66,7 @@ class DataLoadAsyncComponents implements ModuleComponents { } class DataLoadAsyncActions { - final Action loadData = Action(); + final ActionV2 loadData = ActionV2(); } DispatchKey _dispatchKey = DispatchKey('DataLoadAsync'); diff --git a/example/web/panel/modules/flux_module.dart b/example/web/panel/modules/flux_module.dart index 7ff03774..22dd2b1f 100644 --- a/example/web/panel/modules/flux_module.dart +++ b/example/web/panel/modules/flux_module.dart @@ -49,7 +49,7 @@ class FluxComponents implements ModuleComponents { } class FluxActions { - final Action changeBackgroundColor = Action(); + final ActionV2 changeBackgroundColor = ActionV2(); } class FluxStore extends Store { @@ -85,7 +85,7 @@ class _MyFluxComponent extends FluxComponent { 'This module uses a flux pattern to change its background color.', react.button({ 'style': {'padding': '10px', 'margin': '10px'}, - 'onClick': (_) => actions.changeBackgroundColor() + 'onClick': (_) => actions.changeBackgroundColor(null) }, 'Random Background Color') ]); } diff --git a/example/web/panel/modules/hierarchy_module.dart b/example/web/panel/modules/hierarchy_module.dart index cb53a350..69f129c1 100644 --- a/example/web/panel/modules/hierarchy_module.dart +++ b/example/web/panel/modules/hierarchy_module.dart @@ -85,8 +85,8 @@ class HierarchyComponents implements ModuleComponents { } class HierarchyActions { - final Action addChildModule = Action(); - final Action removeChildModule = Action(); + final ActionV2 addChildModule = ActionV2(); + final ActionV2 removeChildModule = ActionV2(); } class HierarchyStore extends Store { diff --git a/example/web/panel/modules/panel_module.dart b/example/web/panel/modules/panel_module.dart index 9cfdcf9b..69c20ac6 100644 --- a/example/web/panel/modules/panel_module.dart +++ b/example/web/panel/modules/panel_module.dart @@ -71,7 +71,7 @@ class PanelComponents implements ModuleComponents { } class PanelActions { - final Action changeToPanel = Action(); + final ActionV2 changeToPanel = ActionV2(); } class PanelStore extends Store { diff --git a/example/web/panel/modules/reject_module.dart b/example/web/panel/modules/reject_module.dart index 0f890d8b..dccd56c1 100644 --- a/example/web/panel/modules/reject_module.dart +++ b/example/web/panel/modules/reject_module.dart @@ -58,7 +58,7 @@ class RejectComponents implements ModuleComponents { } class RejectActions { - final Action toggleShouldUnload = Action(); + final ActionV2 toggleShouldUnload = ActionV2(); } class RejectStore extends Store { @@ -96,7 +96,7 @@ class _RejectComponent extends FluxComponent { 'type': 'checkbox', 'label': 'shouldUnload', 'checked': store.shouldUnload, - 'onChange': (_) => actions.toggleShouldUnload() + 'onChange': (_) => actions.toggleShouldUnload(null) }), 'shouldUnload' ]) diff --git a/example/web/random_color/random_color.dart b/example/web/random_color/random_color.dart index c125f754..f0672c16 100644 --- a/example/web/random_color/random_color.dart +++ b/example/web/random_color/random_color.dart @@ -99,7 +99,7 @@ class RandomColorApi { } void changeBackgroundColor() { - _actions.changeBackgroundColor(); + _actions.changeBackgroundColor(null); } String get currentBackgroundColor => _stores.backgroundColor; @@ -121,8 +121,8 @@ class RandomColorComponents implements ModuleComponents { } class RandomColorActions { - final Action changeBackgroundColor = Action(); - final Action setBackgroundColor = Action(); + final ActionV2 changeBackgroundColor = ActionV2(); + final ActionV2 setBackgroundColor = ActionV2(); } class RandomColorStore extends Store { @@ -176,7 +176,7 @@ class _RandomColorComponent 'This module uses a flux pattern to change its background color.', react.button({ 'style': {'padding': '10px', 'margin': '10px'}, - 'onClick': (_) => actions.changeBackgroundColor() + 'onClick': (_) => actions.changeBackgroundColor(null) }, 'Change Background Color'), react.button({ 'style': {'padding': '10px', 'margin': '10px'},