Skip to content

Commit 9175406

Browse files
Fix flush return type and simplify promise handling
1 parent dcfbb42 commit 9175406

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

splitio_web/lib/splitio_web.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,7 @@ class SplitioWeb extends SplitioPlatform {
695695
bucketingKey: bucketingKey,
696696
);
697697

698-
final result = client.flush();
699-
700-
// @TODO remove wrapping to Future<void> when JS SDK `flush` type is fixed
701-
return result.toDart.then((_) {});
698+
return client.flush().toDart;
702699
}
703700

704701
@override
@@ -709,9 +706,7 @@ class SplitioWeb extends SplitioPlatform {
709706
bucketingKey: bucketingKey,
710707
);
711708

712-
final result = client.destroy();
713-
714-
return result.toDart;
709+
return client.destroy().toDart;
715710
}
716711

717712
@override

splitio_web/lib/src/js_interop.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extension type JS_IBrowserClient._(JSObject _) implements JSObject {
8383
external JSBoolean setAttributes(JSObject attributes);
8484
external JSObject getAttributes();
8585
external JSBoolean clearAttributes();
86-
external JSPromise flush();
86+
external JSPromise<Null> flush();
8787
external JSPromise<Null> destroy();
8888
external JSFunction on;
8989
external JSFunction off;

splitio_web/web/split-browser-1.6.0.full.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)