MockCommand<TParam, TResult> constructor
- {Stream<
bool> canExecute, - bool emitInitialCommandResult: false,
- bool emitLastResult: false,
- bool emitsLastValueToNewSubscriptions: false,
- 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);
}