Skip to content

Commit

Permalink
fixup! feat: improve DataSchemaValue handling
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Dec 28, 2023
1 parent 5f9ebbe commit d50fc60
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/core/interaction_output.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class InteractionOutput implements scripting_api.InteractionOutput {

bool _dataUsed = false;

// TODO: Name these fields
(bool, Object?) _value = (false, null);
({bool read, Object? internalValue}) _value =
(read: false, internalValue: null);

@override
Future<ByteBuffer> arrayBuffer() async {
Expand All @@ -48,8 +48,8 @@ class InteractionOutput implements scripting_api.InteractionOutput {

@override
Future<Object?> value() async {
if (_value.$1) {
return _value.$2;
if (_value.read) {
return _value.internalValue;
}

final schema = this.schema;
Expand All @@ -64,7 +64,7 @@ class InteractionOutput implements scripting_api.InteractionOutput {
);
_dataUsed = true;

_value = (true, value);
_value = (read: true, internalValue: value);
return value;
}

Expand Down

0 comments on commit d50fc60

Please sign in to comment.