execute method

  1. @override
void execute ([TParam param ])
override

Can either be called directly or by calling the object itself because RxCommands are callable classes Will increase executionCount and assign lastPassedValueToExecute the value of param If you have queued a result with queueResultsForNextExecuteCall it will be copies tho the output stream. isExecuting, canExecute and results will work as with a real command.

Implementation

@override
execute([TParam param]) {
  _canExecuteSubject.add(false);
  executionCount++;
  lastPassedValueToExecute = param;
  print("Called Execute");
  if (returnValuesForNextExecute != null) {
    _commandResultsSubject
        .addStream(new Observable<CommandResult<TResult>>.fromIterable(returnValuesForNextExecute).map((data) {
      if ((data.isExecuting || data.hasError) && _emitLastResult) {
        return new CommandResult<TResult>(lastResult, data.error, data.isExecuting);
      }
      return data;
    }));
  } else {
    print("No values for execution queued");
  }
  _canExecuteSubject.add(true);
}