createSyncNoResult<TParam> static method

RxCommand<TParam, void> createSyncNoResult<TParam>(
  1. Action1<TParam> action, {
  2. Stream<bool>? restriction,
  3. bool emitInitialCommandResult = false,
  4. bool emitsLastValueToNewSubscriptions = false,
  5. bool? catchAlways,
  6. String? debugName,
})

Creates a RxCommand for a synchronous handler function with one parameter and no return type action: handler function canExecute : observable that can be used to enable/disable the command based on some other state change if omitted the command can be executed always except it's already executing isExecuting will issue a bool value on each state change. Even if you subscribe to a newly created command it will issue false For the Observable<CommandResult> that RxCommand publishes in results this normally doesn't make sense if you want to get an initial Result with data==null, error==null, isExecuting==false pass emitInitialCommandResult=true. By default the results Observable and the RxCommand itself behave like a PublishSubject. If you want that it acts like a BehaviourSubject, meaning every listener gets the last received value, you can set emitsLastValueToNewSubscriptions = true. debugName optional identifier that is included when you register a globalExceptionHandler or a loggingHandler

Implementation

static RxCommand<TParam, void> createSyncNoResult<TParam>(
  Action1<TParam> action, {
  Stream<bool>? restriction,
  bool emitInitialCommandResult = false,
  bool emitsLastValueToNewSubscriptions = false,
  bool? catchAlways,
  String? debugName,
}) {
  return RxCommandSync<TParam, void>(
    action,
    null,
    restriction,
    emitInitialCommandResult,
    false,
    emitsLastValueToNewSubscriptions,
    null,
    true,
    debugName,
    false,
  );
}