promise method

  1. @Deprecated('Use snapshot() instead')
Future promise([
  1. int timeout = 0
])

Implementation

@Deprecated('Use snapshot() instead')
Future<TTValue> promise([int timeout = 0]) {
  var completer = Completer<TTValue>();
  snapshot(timeout: timeout).then((val) {
    if (!completer.isCompleted) completer.complete(val);
  });
  return completer.future;
}