MockCommand<TParam, TResult> constructor

MockCommand<TParam, TResult>(
  1. {Stream<bool> canExecute,
  2. bool emitInitialCommandResult: false,
  3. bool emitLastResult: false,
  4. bool emitsLastValueToNewSubscriptions: false,
  5. TResult initialLastResult}
)

Factory constructor that can take an optional observable to control if the command can be executet

Implementation

factory MockCommand(
    {Stream<bool> canExecute,
    bool emitInitialCommandResult = false,
    bool emitLastResult = false,
    bool emitsLastValueToNewSubscriptions = false,
    TResult initialLastResult}) {
  return MockCommand._(
      emitsLastValueToNewSubscriptions
          ? BehaviorSubject<TResult>()
          : PublishSubject<TResult>(),
      canExecute,
      emitLastResult,
      false,
      emitInitialCommandResult,
      initialLastResult);
}