Dart Future feature ported to pure javascript