Skip to content

Commit

Permalink
Organize code
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Oct 23, 2024
1 parent 0fb6365 commit ac9baf5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions flutter_package/lib/src/load_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ Future<void> loadJsFile() async {
// as a global JavaScript variable.
wasAlreadyLoaded = js.context.hasProperty('rinfBindings');

// Stop loading if it already has been done.
if (wasAlreadyLoaded) {
return;
} else {
// Create the namespace JavaScript object.
// This namespace object is used by Rust
// to call functions defined in Dart.
js.context['rinfBindings'] = js.JsObject.jsify({});
}

// Create the namespace JavaScript object.
// This namespace object is used by Rust
// to call functions defined in Dart.
js.context['rinfBindings'] = js.JsObject.jsify({});

final loadCompleter = Completer<void>();
rinfBindingsObject['completeRinfLoad'] = loadCompleter.complete;

Expand Down

0 comments on commit ac9baf5

Please sign in to comment.