onSetGlobalVar method

Future<SilentActionResult> onSetGlobalVar(
  1. NodeSpec action,
  2. ActionContext context
)

Implementation

Future<SilentActionResult> onSetGlobalVar(
    NodeSpec action, ActionContext context) async {
  final key = action.props["key"];
  final value = action.props["value"];
  if (key != null && key is String) {
    if (value != null) {
      Lowder.globalVariables[key] = value;
    } else {
      Lowder.globalVariables.remove(key);
    }
  }
  return SilentActionResult(true);
}