alexeyinkin commented on code in PR #24338:
URL: https://github.com/apache/beam/pull/24338#discussion_r1031519898


##########
playground/frontend/lib/modules/examples/example_selector.dart:
##########
@@ -118,8 +88,16 @@ class _ExampleSelectorState extends State<ExampleSelector>
     );
   }
 
+  Future<void> _loadCatalogIfNot(PlaygroundController controller) async {

Review Comment:
   1. This is 4 vs 3 identifiers in a chain.
   2. This mixes async with the Future API.
   3. This relies on runtime type cast.
   
   Lastly, Future API must be avoided when possible: 
https://medium.com/p/2e9c340aabfb
   Of that article, this code is subject to uncaught exceptions in 
`loadAllPrecompiledObjectsIfNot` before the asynchronous gap.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to