MockCommand<TParam, TResult> constructor

MockCommand<TParam, TResult>({Observable<bool> canExecute, bool emitInitialCommandResult: false, bool emitLastResult: false })

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

Implementation

factory MockCommand(
    {Observable<bool> canExecute, bool emitInitialCommandResult = false, bool emitLastResult = false}) {
  return new MockCommand._(
      new BehaviorSubject<CommandResult<TResult>>(
          seedValue: emitInitialCommandResult ? new CommandResult<TResult>(null, null, false) : null),
      canExecute,
      emitLastResult, false);
}