Rule constructor

Rule({
  1. String? id,
  2. List<String>? tags,
  3. required List<Object> conditions,
  4. required List<Object> actions,
  5. int? priority,
})

Implementation

Rule({
  /// Optional identifier that allows referencing this rule.
  String? id,

  /// Tags can be used to annotate rules and perform operations on sets of
  /// rules.
  List<String>? tags,

  /// List of conditions that can trigger the actions.
  required List<Object> conditions,

  /// List of actions that are triggered if one of the conditions is
  /// fulfilled.
  required List<Object> actions,

  /// Optional priority of this rule. Defaults to 100.
  int? priority,
}) : _wrapped = $js.Rule(
        id: id,
        tags: tags?.toJSArray((e) => e),
        conditions: conditions.toJSArray((e) => e.jsify()!),
        actions: actions.toJSArray((e) => e.jsify()!),
        priority: priority,
      );